From: drh Date: Fri, 23 Sep 2016 18:13:01 +0000 (+0000) Subject: New test case for the ORDER BY LIMIT optimization. X-Git-Tag: version-3.15.0~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8dd099bbaa84abf5e240a5b0acef78bccbef54cb;p=thirdparty%2Fsqlite.git New test case for the ORDER BY LIMIT optimization. FossilOrigin-Name: 9a5a489d0d344274d0fc9fb9303503a454f42844 --- diff --git a/manifest b/manifest index 31f00c98b9..0d78852826 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\spotential\snull-pointer\sdereference\sand\scrash\sin\sthe\scase\swhere\sone\nthread\sis\scalling\ssqlite3_column_text()\sand\sanother\sthread\sis\scalling\nsqlite3_step()\son\sthe\ssame\sprepared\sstatement\sat\sthe\ssame\sinstant. -D 2016-09-22T21:37:18.049 +C New\stest\scase\sfor\sthe\sORDER\sBY\sLIMIT\soptimization. +D 2016-09-23T18:13:01.106 F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 5151cc64c4c05f3455f4f692ad11410a810d937f @@ -893,7 +893,7 @@ F test/like.test 81632c437a947bf1f7130b19537da6a1a844806a F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da F test/like3.test 3608a2042b6f922f900fbfd5d3ce4e7eca57f7c4 F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e -F test/limit2.test ac97b8d07060a0280162ba4159e4c0c765861127 +F test/limit2.test 7e7744cc548d7e4c92e1dd3edc30dd0f86adafd5 F test/loadext.test d077450695ddb5c1ea3ad7d48e5f5850fe732ad9 F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7 F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db @@ -1525,7 +1525,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 c3774c6a5fe48af91fda28e9e18c6ed9053ea992 -R 6375993a9d5ddbf71b5ded7742ff83bd +P ee1382a36303eff8d94275ac3b12e5ce398ee620 +R 414a8fb536c6a3f96976785b914f6d34 U drh -Z 824a3b47745c16899f3e858caef9c3bd +Z d5fb1d24e590d07d2266646af9025a8e diff --git a/manifest.uuid b/manifest.uuid index bd5435edc8..b0cfffb335 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ee1382a36303eff8d94275ac3b12e5ce398ee620 \ No newline at end of file +9a5a489d0d344274d0fc9fb9303503a454f42844 \ No newline at end of file diff --git a/test/limit2.test b/test/limit2.test index 0f82ab8d55..4d03180729 100644 --- a/test/limit2.test +++ b/test/limit2.test @@ -109,7 +109,15 @@ do_execsql_test limit2-310 { SELECT *,'.' FROM t300 WHERE a=0 AND (c=0 OR c=99) ORDER BY c DESC LIMIT 1; } {0 1 99 .} - - +# Make sure the SELECT loop is ordered correctly for the direction of +# the ORDER BY +# +do_execsql_test limit2-400 { + CREATE TABLE t400(a,b); + CREATE INDEX t400_ab ON t400(a,b); + INSERT INTO t400(a,b) VALUES(1,90),(1,40),(2,80),(2,30),(3,70),(3,20); + SELECT *,'x' FROM t400 WHERE a IN (1,2,3) ORDER BY b DESC LIMIT 3; + SELECT *,'y' FROM t400 WHERE a IN (1,2,3) ORDER BY +b DESC LIMIT 3; +} {1 90 x 2 80 x 3 70 x 1 90 y 2 80 y 3 70 y} finish_test