From: dan Date: Tue, 12 Mar 2013 18:44:49 +0000 (+0000) Subject: Add test cases for [4dd95f6943]. X-Git-Tag: version-3.7.16~2^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7e8689078edf40dea9c71b06c7c9ec27cdf081d;p=thirdparty%2Fsqlite.git Add test cases for [4dd95f6943]. FossilOrigin-Name: 723c144c76fc171e5d19072d6d42a08013921ec6 --- diff --git a/manifest b/manifest index 22288ce63c..923a152b6d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Revised\sfix\sfor\sthe\sDESC\sORDER\sBY\sand\sIN\sconstraint\sbug,\nticket\s[4dd95f6943fbd18].\s\sThe\sprevious\scheck-in\swas\sincorrect. -D 2013-03-12T18:40:20.150 +C Add\stest\scases\sfor\s[4dd95f6943]. +D 2013-03-12T18:44:49.167 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -778,6 +778,7 @@ F test/tkt-3998683a16.test 6d1d04d551ed1704eb3396ca87bb9ccc8c5c1eb7 F test/tkt-3a77c9714e.test 32bb28afa8c63fc76e972e996193139b63551ed9 F test/tkt-3fe897352e.test 10de1a67bd5c66b238a4c96abe55531b37bb4f00 F test/tkt-4a03edc4c8.test 2865e4edbc075b954daa82f8da7cc973033ec76e +F test/tkt-4dd95f6943.test 906062d9d09a9373f4db23d07afc91efab792149 F test/tkt-54844eea3f.test a12b851128f46a695e4e378cca67409b9b8f5894 F test/tkt-5d863f876e.test c9f36ca503fa154a3655f92a69d2c30da1747bfa F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84 @@ -1037,7 +1038,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 614a038ad2fe111687d2bc1c0aa716d7eb8fdd7c -R 2313f5d24d87760ccf57697a6a9ba832 -U drh -Z 3b6f4b92866e810112286b959abeaefd +P 8b2eb7a43b4580f04c14ea8600cf080e0e7f384d +R 9034788cece44d65e62540f59178537b +U dan +Z 993779e9755bd8c64570dcd5012e8aeb diff --git a/manifest.uuid b/manifest.uuid index 6788caa20e..a1e9dda464 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8b2eb7a43b4580f04c14ea8600cf080e0e7f384d \ No newline at end of file +723c144c76fc171e5d19072d6d42a08013921ec6 \ No newline at end of file diff --git a/test/tkt-4dd95f6943.test b/test/tkt-4dd95f6943.test new file mode 100644 index 0000000000..8fd6bc8074 --- /dev/null +++ b/test/tkt-4dd95f6943.test @@ -0,0 +1,90 @@ +# 2013 March 13 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# This file implements regression tests for SQLite library. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set ::testprefix tkt-4dd95f6943 + +do_execsql_test 1.0 { + CREATE TABLE t1(x); + INSERT INTO t1 VALUES (3), (4), (2), (1), (5), (6); +} + +foreach {tn1 idx} { + 1 { CREATE INDEX i1 ON t1(x ASC) } + 2 { CREATE INDEX i1 ON t1(x DESC) } +} { + do_execsql_test 1.$tn1.1 { DROP INDEX IF EXISTS i1; } + do_execsql_test 1.$tn1.2 $idx + + do_execsql_test 1.$tn1.3 { + SELECT x FROM t1 WHERE x IN(2, 4, 5) ORDER BY x ASC; + } {2 4 5} + + do_execsql_test 1.$tn1.4 { + SELECT x FROM t1 WHERE x IN(2, 4, 5) ORDER BY x DESC; + } {5 4 2} +} + + +do_execsql_test 2.0 { + CREATE TABLE t2(x, y); + INSERT INTO t2 VALUES (5, 3), (5, 4), (5, 2), (5, 1), (5, 5), (5, 6); + INSERT INTO t2 VALUES (1, 3), (1, 4), (1, 2), (1, 1), (1, 5), (1, 6); + INSERT INTO t2 VALUES (3, 3), (3, 4), (3, 2), (3, 1), (3, 5), (3, 6); + INSERT INTO t2 VALUES (2, 3), (2, 4), (2, 2), (2, 1), (2, 5), (2, 6); + INSERT INTO t2 VALUES (4, 3), (4, 4), (4, 2), (4, 1), (4, 5), (4, 6); + INSERT INTO t2 VALUES (6, 3), (6, 4), (6, 2), (6, 1), (6, 5), (6, 6); + + CREATE TABLE t3(a, b); + INSERT INTO t3 VALUES (2, 2), (4, 4), (5, 5); + CREATE INDEX t3i1 ON t3(a ASC); + CREATE INDEX t3i2 ON t3(b DESC); +} + +foreach {tn1 idx} { + 1 { CREATE INDEX i1 ON t2(x ASC, y ASC) } + 2 { CREATE INDEX i1 ON t2(x ASC, y DESC) } + 3 { CREATE INDEX i1 ON t2(x DESC, y ASC) } + 4 { CREATE INDEX i1 ON t2(x DESC, y DESC) } + + 5 { CREATE INDEX i1 ON t2(y ASC, x ASC) } + 6 { CREATE INDEX i1 ON t2(y ASC, x DESC) } + 7 { CREATE INDEX i1 ON t2(y DESC, x ASC) } + 8 { CREATE INDEX i1 ON t2(y DESC, x DESC) } +} { + do_execsql_test 2.$tn1.1 { DROP INDEX IF EXISTS i1; } + do_execsql_test 2.$tn1.2 $idx + + foreach {tn2 inexpr} { + 1 "(2, 4, 5)" + 2 "(SELECT a FROM t3)" + 3 "(SELECT b FROM t3)" + } { + do_execsql_test 2.$tn1.3 " + SELECT x, y FROM t2 WHERE x = 1 AND y IN $inexpr ORDER BY x ASC, y ASC; + " {1 2 1 4 1 5} + do_execsql_test 2.$tn1.4 " + SELECT x, y FROM t2 WHERE x = 2 AND y IN $inexpr ORDER BY x ASC, y DESC; + " {2 5 2 4 2 2} + do_execsql_test 2.$tn1.5 " + SELECT x, y FROM t2 WHERE x = 3 AND y IN $inexpr ORDER BY x DESC, y ASC; + " {3 2 3 4 3 5} + do_execsql_test 2.$tn1.6 " + SELECT x, y FROM t2 WHERE x = 4 AND y IN $inexpr ORDER BY x DESC, y DESC; + " {4 5 4 4 4 2} + } +} + +finish_test +