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

Tighter VDBE code for the WHERE_DISTINCT_ORDERED case of DISTINCT keyword

handling.

FossilOrigin-Name: 94b48064db3cbb43e911fdf7183218b08146ec10
This commit is contained in:
drh
2012-09-19 21:15:46 +00:00
parent ae651d614e
commit 053a128f55
6 changed files with 73 additions and 32 deletions

View File

@ -178,7 +178,23 @@ do_execsql_test 2.A {
SELECT (SELECT DISTINCT o.a FROM t1 AS i) FROM t1 AS o ORDER BY rowid;
} {a A a A}
do_test 3.0 {
db eval {
CREATE TABLE t3(a INTEGER, b INTEGER, c, UNIQUE(a,b));
INSERT INTO t3 VALUES
(null, null, 1),
(null, null, 2),
(null, 3, 4),
(null, 3, 5),
(6, null, 7),
(6, null, 8);
SELECT DISTINCT a, b FROM t3 ORDER BY +a, +b;
}
} {{} {} {} 3 6 {}}
do_test 3.1 {
regexp {OpenEphemeral} [db eval {
EXPLAIN SELECT DISTINCT a, b FROM t3 ORDER BY +a, +b;
}]
} {0}
finish_test