Commit d3c593a
authored
Merge 'fix: default
### Issue
generate_series with only a START argument (e.g. generate_series(1) or
generate_series WHERE start = 5) returned no rows. Per SQLite, omitted
STOP should default to 4294967295, and the series should run from START
to 4294967295 with STEP 1. In the virtual table's filter method, when
STOP was absent, it stayed -1, triggering ResultCode::EOF and producing
an empty series.
### Fix
When STOP is not provided as a constraint (idx_num & 2 == 0), set stop =
4294967295 (u32::MAX) in the filter method. The existing stop == -1
check remains for explicitly provided invalid values.
### Testing
Added `testing/runner/tests/generate_series.sqltest` with tests for:
- Single-arg default stop (function call and WHERE form)
- Two-arg and three-arg forms (regression)
- Explicit STOP = -1 (empty series preserved)
#3393
Used to query codebase for patterns surrounding the use of constants in
functions as well as generating the testcases based off my description
of what to test for.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes #5472generate_series STOP to SQLite Default (4294967295) when omitted' from Damian Melia2 files changed
+47
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments