Repository navigation
Commit 6cc331b
committed
Build empty result sets from an unexecuted statement
Empty result sets used a no-op INSERT into a TEMP table that was created
on first use. When the first use happened in a transaction, for example
for START TRANSACTION itself, a rollback dropped the table, while the
driver still assumed it existed. Every later statement with an empty
result set then failed with "Table '_wp_sqlite_empty_result' doesn't
exist".
Use a prepared statement that is never executed instead. It needs no
table and takes no locks, and its row count is always 0. Closing its
cursor sets its error code to "00000", so it reports errors and iterates
like an executed statement.
Add regression tests for the rollback, and a test for the empty result
statement API, so that CI catches any PHP change in this behavior.
See #5351 parent 4d94f39 commit 6cc331b
2 files changed
Lines changed: 94 additions & 41 deletions
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 85 | | |
92 | 86 | | |
93 | 87 | | |
| |||
678 | 672 | | |
679 | 673 | | |
680 | 674 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | 675 | | |
690 | 676 | | |
691 | 677 | | |
| |||
7741 | 7727 | | |
7742 | 7728 | | |
7743 | 7729 | | |
7744 | | - | |
7745 | | - | |
| 7730 | + | |
| 7731 | + | |
| 7732 | + | |
| 7733 | + | |
| 7734 | + | |
| 7735 | + | |
| 7736 | + | |
| 7737 | + | |
| 7738 | + | |
| 7739 | + | |
| 7740 | + | |
| 7741 | + | |
| 7742 | + | |
| 7743 | + | |
| 7744 | + | |
| 7745 | + | |
7746 | 7746 | | |
7747 | 7747 | | |
7748 | | - | |
7749 | | - | |
7750 | | - | |
7751 | | - | |
7752 | | - | |
7753 | | - | |
7754 | | - | |
7755 | | - | |
7756 | | - | |
7757 | | - | |
7758 | | - | |
7759 | | - | |
7760 | | - | |
7761 | | - | |
7762 | | - | |
7763 | | - | |
7764 | | - | |
7765 | | - | |
7766 | | - | |
7767 | | - | |
7768 | | - | |
7769 | | - | |
7770 | | - | |
7771 | | - | |
7772 | | - | |
| 7748 | + | |
| 7749 | + | |
| 7750 | + | |
7773 | 7751 | | |
7774 | 7752 | | |
7775 | 7753 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
532 | 584 | | |
533 | 585 | | |
534 | 586 | | |
| |||
888 | 940 | | |
889 | 941 | | |
890 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
891 | 966 | | |
892 | 967 | | |
893 | 968 | | |
| |||
0 commit comments