Repository navigation
Commit 0a375cc
committed
Fix rowCount() of result sets without rows
For a statement that returns a result set but no rows, PDO SQLite's
rowCount() reports the row count of the last write on the connection.
The driver passed that value through, so an empty SELECT after a write
reported the written rows. This includes the driver's internal writes,
such as the information schema rows written by CREATE TABLE.
Report 0 for all statements that return a result set, as it already was
for result sets with rows.
Until the previous commit, the no-op INSERT used for empty result sets
reset the counter after statements like SET or CREATE TABLE, which hid
some of these cases.1 parent 6cc331b commit 0a375cc
2 files changed
Lines changed: 27 additions & 1 deletion
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
767 | 767 | | |
768 | 768 | | |
769 | 769 | | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
770 | 785 | | |
771 | 786 | | |
772 | 787 | | |
| |||
0 commit comments