Add tests for sort-by-index cases that use IN() and non-default NULL handling.

FossilOrigin-Name: 09d660ecde723fb30f3bb3684bbb7f95825d78da6a6f33ddf57846054cd563e0
This commit is contained in:
dan 2019-08-20 17:51:13 +00:00
parent 4fcb9caa60
commit 2a0c16f276
3 changed files with 63 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Do\snot\spass\sORDER\sBY\sclauses\swith\snon-standard\sNULL\shandling\sto\svirtual\stable\simplementations.
D 2019-08-20T15:47:28.909
C Add\stests\sfor\ssort-by-index\scases\sthat\suse\sIN()\sand\snon-default\sNULL\shandling.
D 2019-08-20T17:51:13.442
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -1182,7 +1182,7 @@ F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161
F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934
F test/notnull.test a37b663d5bb728d66fc182016613fb8e4a0a4bbf3d75b8876a7527f7d4ed3f18
F test/null.test 0dcce4f04284ec66108c503327ad6d224c0752b3
F test/nulls1.test 085aae8cd3442159d993e6b5317b7503a71d82107ab1a87390a370d5891945f9
F test/nulls1.test abf8ab564357136d0a1c9909ab068d4fcb0a5e94e168bed6b6c6f548a6f56d07
F test/numcast.test 5d126f7f581432e86a90d1e35cac625164aec4a1
F test/numindex1.test 20a5450d4b056e48cd5db30e659f13347a099823
F test/offset1.test f06b83657bcf26f9ce805e67450e189e282143b2
@ -1837,7 +1837,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 75d665a494dd7d6e77d5a80af386ee5accc0a53416d5493424dc0fef6c7b01a0
R c52f59575d6f8f4774d29df09eb77ad3
P a9a82ee88d2d12209a674bd19167277aa91a6912e7a8bbf3714f90d559307fee
R 72239629606cb191b8fd5443e5ad57ff
U dan
Z b71d521722a995099edda82dc88d1b7f
Z 5d1aadbb6bb817df7ca002049c5a7d6e

View File

@ -1 +1 @@
a9a82ee88d2d12209a674bd19167277aa91a6912e7a8bbf3714f90d559307fee
09d660ecde723fb30f3bb3684bbb7f95825d78da6a6f33ddf57846054cd563e0

View File

@ -119,6 +119,7 @@ do_execsql_test 3.2 {
}
#-------------------------------------------------------------------------
#
ifcapable vtab {
register_echo_module db
do_execsql_test 4.0 {
@ -147,4 +148,59 @@ ifcapable vtab {
} {1 1 1 3 3 3 5 5 5 2 {} 2 4 {} 4}
}
#-------------------------------------------------------------------------
#
do_execsql_test 5.0 {
CREATE TABLE t4(a, b, c);
INSERT INTO t4 VALUES(1, 1, 11);
INSERT INTO t4 VALUES(1, 2, 12);
INSERT INTO t4 VALUES(1, NULL, 1);
INSERT INTO t4 VALUES(2, NULL, 1);
INSERT INTO t4 VALUES(2, 2, 12);
INSERT INTO t4 VALUES(2, 1, 11);
INSERT INTO t4 VALUES(3, NULL, 1);
INSERT INTO t4 VALUES(3, 2, 12);
INSERT INTO t4 VALUES(3, NULL, 3);
}
do_execsql_test 5.1 {
SELECT * FROM t4 WHERE a IN (1, 2, 3) ORDER BY a, b NULLS LAST
} {
1 1 11 1 2 12 1 {} 1
2 1 11 2 2 12 2 {} 1
3 2 12 3 {} 1 3 {} 3
}
do_execsql_test 5.2 {
CREATE INDEX t4ab ON t4(a, b);
SELECT * FROM t4 WHERE a IN (1, 2, 3) ORDER BY a, b NULLS LAST
} {
1 1 11 1 2 12 1 {} 1
2 1 11 2 2 12 2 {} 1
3 2 12 3 {} 1 3 {} 3
}
do_eqp_test 5.3 {
SELECT * FROM t4 WHERE a IN (1, 2, 3) ORDER BY a, b NULLS LAST
} {
QUERY PLAN
`--SEARCH TABLE t4 USING INDEX t4ab (a=?)
}
do_execsql_test 5.4 {
SELECT * FROM t4 WHERE a IN (1, 2, 3) ORDER BY a DESC, b DESC NULLS FIRST
} {
3 {} 3 3 {} 1 3 2 12
2 {} 1 2 2 12 2 1 11
1 {} 1 1 2 12 1 1 11
}
do_eqp_test 5.5 {
SELECT * FROM t4 WHERE a IN (1, 2, 3) ORDER BY a DESC, b DESC NULLS FIRST
} {
QUERY PLAN
`--SEARCH TABLE t4 USING INDEX t4ab (a=?)
}
finish_test