From: danielk1977 Date: Mon, 16 Jun 2008 06:31:34 +0000 (+0000) Subject: Add a test to verify that IN(...) WHERE clause terms are not handled by virtual table... X-Git-Tag: version-3.6.10~956 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fce96308b16e2230ed0ccb9e8ee085770177a370;p=thirdparty%2Fsqlite.git Add a test to verify that IN(...) WHERE clause terms are not handled by virtual table implemetations. (CVS 5221) FossilOrigin-Name: 85483c8fb3b45281ce07e84349841fc80e560b1f --- diff --git a/manifest b/manifest index 97f0fb8d45..8065c5040e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Continuing\swork\son\sthe\snew\smemory\sallocation\ssubsystem.\nAdded\sroutines\sfor\stemporary\smemory\sallocation.\s\sRight\sthe\sbtree\nbalance\smechanism\sto\sonly\sdo\sone\stemporary\sallocation\sat\sa\stime.\s(CVS\s5220) -D 2008-06-15T02:51:47 +C Add\sa\stest\sto\sverify\sthat\sIN(...)\sWHERE\sclause\sterms\sare\snot\shandled\sby\svirtual\stable\simplemetations.\s(CVS\s5221) +D 2008-06-16T06:31:35 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in dc5608df93faf4406cfd7a1c8ed9ab93d8bfbfd5 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -548,7 +548,7 @@ F test/vacuum3.test 6149b24613f487915ca9cedfbb9147d5759714ec F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102 F test/veryquick.test c08b303a9a6e5bbb27d0988858e919f3b70042aa F test/view.test 4864e3841ab3213a95297718b94d5d6a8d3bc78b -F test/vtab1.test b1e4bf536efd83c24feb303699001fa886e2256b +F test/vtab1.test 47092e3ac59141f08e09a6c0cc0df8997242bc79 F test/vtab2.test 1da49b015582965a8fc386aa23d051a5a622b08e F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587 F test/vtab4.test a9d7104d41a787754a734740d7aa61c807a69f87 @@ -594,7 +594,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P f00305f4cd2f487f660f34a21c1c24a0b37c7275 -R 959050eddfb58749f141d64dc00b9d92 -U drh -Z a529f10f0af791d96bfc33f5cbab9f39 +P 65fe7b62cfe7d11cd667681a64c96fe7b2fe5685 +R 5c46ebc86e0ac8318bbd836a9634196f +U danielk1977 +Z d1c404b0ce37dd5dd64aa7a93fc28b2d diff --git a/manifest.uuid b/manifest.uuid index e562e1d474..97203ffa2d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -65fe7b62cfe7d11cd667681a64c96fe7b2fe5685 \ No newline at end of file +85483c8fb3b45281ce07e84349841fc80e560b1f \ No newline at end of file diff --git a/test/vtab1.test b/test/vtab1.test index c40d19f852..625928d98f 100644 --- a/test/vtab1.test +++ b/test/vtab1.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is creating and dropping virtual tables. # -# $Id: vtab1.test,v 1.52 2008/04/10 16:42:59 drh Exp $ +# $Id: vtab1.test,v 1.53 2008/06/16 06:31:35 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -41,6 +41,8 @@ ifcapable !vtab||!schema_pragmas { # * How to test the sqlite3_index_constraint_usage.omit field? # * vtab1-5.* # +# vtab1-14.*: Test 'IN' constraints - i.e. "SELECT * FROM t1 WHERE id IN(...)" +# #---------------------------------------------------------------------- @@ -1010,8 +1012,6 @@ do_test vtab1.12-3 { execsql { SELECT * FROM c } } {3 G H} -breakpoint - # Now the real test - wrapped in a transaction. do_test vtab1.12-4 { execsql {BEGIN} @@ -1055,5 +1055,31 @@ do_test vtab1.13-3 { } } {15 {} 16} + +do_test vtab1-14.1 { + execsql { DELETE FROM c } + set echo_module "" + execsql { SELECT * FROM echo_c WHERE rowid IN (1, 2, 3) } + set echo_module +} [list xBestIndex {SELECT rowid, * FROM 'c'} xFilter {SELECT rowid, * FROM 'c'}] + +do_test vtab1-14.2 { + set echo_module "" + execsql { SELECT * FROM echo_c WHERE rowid = 1 } + set echo_module +} [list xBestIndex {SELECT rowid, * FROM 'c' WHERE rowid = ?} xFilter {SELECT rowid, * FROM 'c' WHERE rowid = ?} 1] + +do_test vtab1-14.3 { + set echo_module "" + execsql { SELECT * FROM echo_c WHERE a = 1 } + set echo_module +} [list xBestIndex {SELECT rowid, * FROM 'c' WHERE a = ?} xFilter {SELECT rowid, * FROM 'c' WHERE a = ?} 1] + +do_test vtab1-14.4 { + set echo_module "" + execsql { SELECT * FROM echo_c WHERE a IN (1, 2) } + set echo_module +} [list xBestIndex {SELECT rowid, * FROM 'c'} xFilter {SELECT rowid, * FROM 'c'}] + unset -nocomplain echo_module_begin_fail finish_test