Repository navigation
Commit d56c4a1
Fix FOUND_ROWS() for more than nine rows without SQL_CALC_FOUND_ROWS
After a SELECT without SQL_CALC_FOUND_ROWS or after a SHOW statement,
FOUND_ROWS() counts the rows of the previous query. The count was read
with fetchColumn()[0], which takes the first character of a stringified
count, so FOUND_ROWS() returned "1" for 12 rows. Without stringified
fetches, indexing the integer count returned null, and the result was 0.
Use the fetched count directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 6546e45 commit d56c4a1
2 files changed
Lines changed: 20 additions & 2 deletions
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5161 | 5161 | | |
5162 | 5162 | | |
5163 | 5163 | | |
5164 | | - | |
| 5164 | + | |
5165 | 5165 | | |
5166 | 5166 | | |
5167 | 5167 | | |
5168 | 5168 | | |
5169 | | - | |
| 5169 | + | |
5170 | 5170 | | |
5171 | 5171 | | |
5172 | 5172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4186 | 4186 | | |
4187 | 4187 | | |
4188 | 4188 | | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
4189 | 4207 | | |
4190 | 4208 | | |
4191 | 4209 | | |
| |||
0 commit comments