From 27e6df4e41f832921c92028e88e58f3c287bfd25 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 13 Mar 2013 07:02:04 +0000 Subject: [PATCH] Enhance tests for ticket [4dd95f6943]. FossilOrigin-Name: 0b452734faa0839c817f040322e7733e423bfce2 --- manifest | 14 ++++---- manifest.uuid | 2 +- test/tkt-4dd95f6943.test | 74 +++++++++++++++++++++++++++++++++------- 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index b60645888e..42eb32ea0f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sORDER\sBY\swith\sIN\sconstraint\slogic\sso\sthat\sit\sworks\swith\sall\ncombinations\sof\sDESC\son\sthe\sORDER\sBY\sclause,\son\sthe\sRHS\sof\sthe\sIN\soperator,\nand\sin\sthe\sindex\sused\sby\sORDER\sBY\sand\sIN.\s\s\nFix\sfor\sticket\s[4dd95f6943fbd18]. -D 2013-03-13T00:13:25.181 +C Enhance\stests\sfor\sticket\s[4dd95f6943]. +D 2013-03-13T07:02:04.083 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -778,7 +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 b7fad82ce61a2650fa4861f903ee002c253730c3 +F test/tkt-4dd95f6943.test 3d0ce415d2ee15d3d564121960016b9c7be79407 F test/tkt-54844eea3f.test a12b851128f46a695e4e378cca67409b9b8f5894 F test/tkt-5d863f876e.test c9f36ca503fa154a3655f92a69d2c30da1747bfa F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84 @@ -1038,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 c9a75d890f06cf3806d7b8879824a11d3a8e7016 7e7356f1552cd53ea363d1ded3b2c221c9d0be01 -R cf70d6af777786d8b14ff574243c0031 -U drh -Z ef3fb703f5f65c616953904db1b81e9f +P 839aa91faf1db7025d90fa3c65e50efb829b053b +R ad71abb6cd4a6ebc6857153126653bad +U dan +Z 69b39b8becc09fc4758d1b797bf5f4f2 diff --git a/manifest.uuid b/manifest.uuid index 31a34e8a08..3d8be2e93e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -839aa91faf1db7025d90fa3c65e50efb829b053b \ No newline at end of file +0b452734faa0839c817f040322e7733e423bfce2 \ No newline at end of file diff --git a/test/tkt-4dd95f6943.test b/test/tkt-4dd95f6943.test index 6590118370..353031e74e 100644 --- a/test/tkt-4dd95f6943.test +++ b/test/tkt-4dd95f6943.test @@ -48,8 +48,8 @@ do_execsql_test 2.0 { 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); + CREATE UNIQUE INDEX t3i1 ON t3(a ASC); + CREATE UNIQUE INDEX t3i2 ON t3(b DESC); } foreach {tn1 idx} { @@ -67,22 +67,61 @@ foreach {tn1 idx} { do_execsql_test 2.$tn1.2 $idx foreach {tn2 inexpr} { - 1 "(2, 4, 5)" - 2 "(SELECT a FROM t3)" - 3 "(SELECT b FROM t3)" + 3 "(2, 4, 5)" + 4 "(SELECT a FROM t3)" + 5 "(SELECT b FROM t3)" } { - do_execsql_test 2.$tn1.3 " + do_execsql_test 2.$tn1.$tn2.1 " 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 " + + do_execsql_test 2.$tn1.$tn2.2 " 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 " + + do_execsql_test 2.$tn1.$tn2.3 " 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 " + + do_execsql_test 2.$tn1.$tn2.4 " SELECT x, y FROM t2 WHERE x = 4 AND y IN $inexpr ORDER BY x DESC, y DESC; " {4 5 4 4 4 2} + + do_execsql_test 2.$tn1.$tn2.5 " + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + ORDER BY a, x ASC, y ASC; + " {4 1 2 4 1 4 4 1 5} + do_execsql_test 2.$tn1.$tn2.6 " + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + ORDER BY x ASC, y ASC; + " {2 1 2 2 1 4 2 1 5} + + do_execsql_test 2.$tn1.$tn2.7 " + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + ORDER BY a, x ASC, y DESC; + " {4 1 5 4 1 4 4 1 2} + do_execsql_test 2.$tn1.8 " + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + ORDER BY x ASC, y DESC; + " {2 1 5 2 1 4 2 1 2} + + do_execsql_test 2.$tn1.$tn2.9 " + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + ORDER BY a, x DESC, y ASC; + " {4 1 2 4 1 4 4 1 5} + do_execsql_test 2.$tn1.10 " + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + ORDER BY x DESC, y ASC; + " {2 1 2 2 1 4 2 1 5} + + do_execsql_test 2.$tn1.$tn2.11 " + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + ORDER BY a, x DESC, y DESC; + " {4 1 5 4 1 4 4 1 2} + do_execsql_test 2.$tn1.$tn2.12 " + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + ORDER BY x DESC, y DESC; + " {2 1 5 2 1 4 2 1 2} } } @@ -93,9 +132,20 @@ do_execsql_test 3.0 { CREATE TABLE t8(y); INSERT INTO t8 VALUES (1), (2), (3); +} - CREATE UNIQUE INDEX i8 ON t8(y DESC); - SELECT x FROM t7 WHERE x IN (SELECT y FROM t8) ORDER BY x ASC; -} {1 2 3} +foreach {tn idxdir sortdir sortdata} { + 1 ASC ASC {1 2 3} + 2 ASC DESC {3 2 1} + 3 DESC ASC {1 2 3} + 4 ASC DESC {3 2 1} +} { + + do_execsql_test 3.$tn " + DROP INDEX IF EXISTS i8; + CREATE UNIQUE INDEX i8 ON t8(y $idxdir); + SELECT x FROM t7 WHERE x IN (SELECT y FROM t8) ORDER BY x $sortdir; + " $sortdata +} finish_test -- 2.47.2