1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Towards getting ORDER BY to match against the correctin columns.

This version only looks at the left-most column in a compound SELECT.
That is the correct thing to do, but not what SQLite has historically done. (CVS 4620)

FossilOrigin-Name: bbddf16ac9539c7d48adfc73c5a90eecb8df6865
This commit is contained in:
drh
2007-12-13 02:45:31 +00:00
parent 9019f4a65f
commit 9a99334d54
5 changed files with 262 additions and 161 deletions

View File

@ -153,11 +153,26 @@ do_test null-5.1 {
# as distinct
#
ifcapable compound {
do_test null-6.1 {
execsql {
select b from t1 union select c from t1 order by c;
}
} {{} 0 1}
do_test null-6.1 {
execsql {
select b from t1 union select c from t1 order by b;
}
} {{} 0 1}
do_test null-6.2 {
execsql {
select b from t1 union select c from t1 order by 1;
}
} {{} 0 1}
do_test null-6.3 {
execsql {
select b from t1 union select c from t1 order by t1.b;
}
} {{} 0 1}
do_test null-6.4 {
execsql {
select b from t1 union select c from t1 order by main.t1.b;
}
} {{} 0 1}
} ;# ifcapable compound
# The UNIQUE constraint only applies to non-null values