mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 09:04:19 +01:00
Fix computation of argv_index in best_index
The `filter` methods for extensions affected by this fix expect arguments to be passed in a specific order. For example, `generate_series` assumes that if the `start` argument exists, it is always passed to `filter` first. If `start` does not exist, then `stop` is passed first — but `stop` must never come before `start`. Previously, this was not guaranteed: `best_index` relied on constraints being passed in the order matching `filter`'s expectations.
This commit is contained in:
@@ -320,6 +320,10 @@ def _test_series(limbo: TestTursoShell):
|
||||
"SELECT * FROM generate_series WHERE start = 1 AND stop = 10;",
|
||||
lambda res: res == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10",
|
||||
)
|
||||
limbo.run_test_fn(
|
||||
"SELECT * FROM generate_series WHERE stop = 10 AND start = 1;",
|
||||
lambda res: res == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10",
|
||||
)
|
||||
limbo.run_test_fn(
|
||||
"SELECT * FROM generate_series(1, 10) WHERE value < 5;",
|
||||
lambda res: res == "1\n2\n3\n4",
|
||||
|
||||
Reference in New Issue
Block a user