From: drh Date: Thu, 13 Aug 2009 17:14:59 +0000 (+0000) Subject: Add a test case for the affinity problem reported by ticket [93fb9f89d6]. X-Git-Tag: fts3-refactor~272 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9fa7207b1b525320f3e0face3c712df3d7b91260;p=thirdparty%2Fsqlite.git Add a test case for the affinity problem reported by ticket [93fb9f89d6]. FossilOrigin-Name: 149ec24e61437fac2b0dd6239276d3aa543c56cb --- diff --git a/manifest b/manifest index 276193c15b..2654825fac 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Merge\sthe\saccidental\sfork. -D 2009-08-13T15:42:52 +C Add\sa\stest\scase\sfor\sthe\saffinity\sproblem\sreported\sby\sticket\s[93fb9f89d6]. +D 2009-08-13T17:14:59 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c606c9b502dfde3b9c3b2d23ed49f3737829693b F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -718,6 +718,7 @@ F test/where8.test 8d3704d04a683e792d373005f2e4e13bfd7e2dd5 F test/where8m.test da346596e19d54f0aba35ebade032a7c47d79739 F test/where9.test be19e1a92f80985c1a121b4678bf7d2123eaa623 F test/whereA.test 1d1674254614147c866ab9b59af6582f454a858c +F test/whereB.test 2177e36b7c91ecfa2f93451baaa999f92920e4b9 F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b @@ -745,14 +746,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P b5a709d3609d40a6e5ef77f9889077d7395d3d26 19f799b32f9d1be25d4185ce18b13f4dd502e199 -R ab41ee398e311449a6447494098a83fa +P 86a06dd0494c2fe83d4fde517557600956cedd9e +R 0dee14fd47141ebb408793860d7adc78 U drh -Z b589a26f62eacda54d72d773c2f21084 +Z 12818b10386eaf5266bfaceb670cd6e6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKhDR/oxKgR168RlERApwTAJ9tk5whkfe/L35NGftqAQgymtHvzgCeItIr -T+WsDYk3Sl3YexQvu3qmYi8= -=kIse +iD8DBQFKhEoWoxKgR168RlERApGFAJ4vhn79VZ+xTwID/EoYDATCU6CmYwCfWfLb +UlueAOSuLnKpUnxIxdrIeU8= +=Gh8W -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index de120d1768..1cbc3509c5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -86a06dd0494c2fe83d4fde517557600956cedd9e \ No newline at end of file +149ec24e61437fac2b0dd6239276d3aa543c56cb \ No newline at end of file diff --git a/test/whereB.test b/test/whereB.test new file mode 100644 index 0000000000..fe7e33a646 --- /dev/null +++ b/test/whereB.test @@ -0,0 +1,116 @@ +# 2009 August 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. The +# focus of this file is testing WHERE clause conditions with +# subtle affinity issues. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_test whereB-1.1 { + db eval { + CREATE TABLE t1(x,y); -- affinity of t1.y is NONE + INSERT INTO t1 VALUES(1,2); + INSERT INTO t1 VALUES(2,7); + + CREATE TABLE t2(a, b TEXT); -- affinity of t2.b is TEXT + CREATE INDEX t2b ON t2(b); + INSERT INTO t2 VALUES(11,2); + INSERT INTO t2 VALUES(12,6); + + SELECT x, a, y=b FROM t1, t2 ORDER BY +x, +a; + } +} {1 11 0 1 12 0 2 11 0 2 12 0} +do_test whereB-1.2 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE y=b ORDER BY +x, +a; + } +} {} +do_test whereB-1.3 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE b=y ORDER BY +x, +a; + } +} {} +do_test whereB-1.4 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE +y=+b ORDER BY +x, +a; + } +} {} +do_test whereB-1.100 { + db eval { + DROP INDEX t2b; + SELECT x, a, y=b FROM t1, t2 WHERE y=b ORDER BY +x, +a; + } +} {} +do_test whereB-1.101 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE b=y ORDER BY +x, +a; + } +} {} +do_test whereB-1.102 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE +y=+b ORDER BY +x, +a; + } +} {} + +do_test whereB-2.1 { + db eval { + DROP TABLE t1; + DROP TABLE t2; + + CREATE TABLE t1(x,y); -- affinity of t1.y is NONE + INSERT INTO t1 VALUES(1,2); + INSERT INTO t1 VALUES(2,7); + + CREATE TABLE t2(a, b UNKNOWN); -- affinity of t2.b is NUMERIC + CREATE INDEX t2b ON t2(b); + INSERT INTO t2 VALUES(11,2); + INSERT INTO t2 VALUES(12,6); + + SELECT x, a, y=b FROM t1, t2 ORDER BY +x, +a; + } +} {1 11 1 1 12 0 2 11 0 2 12 0} +do_test whereB-2.2 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE y=b ORDER BY +x, +a; + } +} {1 11 1} +do_test whereB-2.3 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE b=y ORDER BY +x, +a; + } +} {1 11 1} +do_test whereB-2.4 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE +y=+b ORDER BY +x, +a; + } +} {1 11 1} +do_test whereB-2.100 { + db eval { + DROP INDEX t2b; + SELECT x, a, y=b FROM t1, t2 WHERE y=b ORDER BY +x, +a; + } +} {1 11 1} +do_test whereB-2.101 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE b=y ORDER BY +x, +a; + } +} {1 11 1} +do_test whereB-2.102 { + db eval { + SELECT x, a, y=b FROM t1, t2 WHERE +y=+b ORDER BY +x, +a; + } +} {1 11 1} + + + +finish_test