1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Enhance the virtual table query planner so that it is able to deal with

ORDER BY terms that contain COLLATE clauses as long as the specified
collation matches the virtual table.  This is especially important for
UNION ALL since a "COLLATE binary" is added to ORDER BY clauses if no
COLLATE clause exists in the original SQL.

FossilOrigin-Name: 5c3d398d20b86a1558720e995eddf11403aec2d160590571fa9525fe8f6efff9
This commit is contained in:
drh
2021-12-14 20:13:28 +00:00
parent 22f018c938
commit 52576b78f6
4 changed files with 61 additions and 9 deletions

View File

@@ -145,6 +145,23 @@ do_eqp_test tabfunc01-3.13 {
}
do_eqp_test tabfunc01-3.20 {
WITH t1(a) AS (
SELECT value FROM generate_series(0,10,2)
UNION ALL
SELECT value FROM generate_series(9,18,3)
)
SELECT * FROM t1 ORDER BY a;
} {
QUERY PLAN
`--MERGE (UNION ALL)
|--LEFT
| `--SCAN generate_series VIRTUAL TABLE INDEX 23:
`--RIGHT
`--SCAN generate_series VIRTUAL TABLE INDEX 23:
}
# Eponymous virtual table exists in all schemas.
#
do_execsql_test tabfunc01-4.1 {