Modify test scripts to work when SQLITE_OMIT_SUBQUERY (along with other OMIT macros) is defined. (CVS 2251)

FossilOrigin-Name: bb0254ab14417f0ab40f10f37cb63a60507f070a
This commit is contained in:
danielk1977 2005-01-21 03:12:14 +00:00
parent 801845fb2d
commit 3e8c37e7f8
33 changed files with 897 additions and 677 deletions

View File

@ -1,5 +1,5 @@
C Add\sa\snew\stest\sfile\sfor\ssubqueries.\s(CVS\s2250)
D 2005-01-21T02:34:44
C Modify\stest\sscripts\sto\swork\swhen\sSQLITE_OMIT_SUBQUERY\s(along\swith\sother\sOMIT\smacros)\sis\sdefined.\s(CVS\s2251)
D 2005-01-21T03:12:15
F Makefile.in ffd81f5e926d40b457071b4de8d7c1fa18f39b5a
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@ -54,17 +54,17 @@ F src/os_win.c 3c0b0a3bc33318cf555a1cd130232ad1b9a5a711
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c 05d23abbcfa3133f716a99589e53883c10551b1f
F src/pager.h 9eba8c53dd91eae7f3f90743b2ee242da02a9862
F src/parse.y 301d07db056f5125806e84994b5f41a8355d28ad
F src/parse.y 5f2c197fcb63c6aed1787da436ec5a35247ab7a4
F src/pragma.c 8ab313986673aa4c45e8693d8aabb9b95ee7b14a
F src/printf.c 3d20b21cfecadacecac3fb7274e746cb81d3d357
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c d8f5c8b44922d9e295a32be941d0a416cda94f98
F src/shell.c 591364a0e9ca4ce53873e21e0294476c0c2b4770
F src/sqlite.h.in 8249b697d71ef6d7f7f752ba4ca04058e9e8b5ff
F src/sqliteInt.h 9a582fcb8333b5a30706250282d9697654305dbc
F src/sqliteInt.h 01ea63415bb96ad8ab6e26bede2aa6a39cefb082
F src/table.c 25b3ff2b39b7d87e8d4a5da0713d68dfc06cbee9
F src/tclsqlite.c fd27457b228118be96524dae285146c76efe032b
F src/test1.c 59fc0f0c35cb3bccdf166f36a1a5f9ffb0b951e7
F src/test1.c c4f2a1d6ad8f14a1168a4c933ce5c5cb2d243d86
F src/test2.c bbc2ecc58ceeab12d1e40970f831b1017524e40d
F src/test3.c 5c2ec5c8eb689ac93fb0546f84b310659ad287c6
F src/test4.c 7c6b9fc33dd1f3f93c7f1ee6e5e6d016afa6c1df
@ -90,7 +90,7 @@ F test/attach2.test eeb987770f4dbe68bd29afdbc2e8cff0142e6eb5
F test/attach3.test c05c70b933afbde0901dab9da3e66ee842c09f38
F test/auth.test 559e0816b8100740624ebb0ab7aab05f5c92831c
F test/autoinc.test c071e51ff167b8e889212273588d9cca71845b70
F test/autovacuum.test a15021f685f2b3be5ad120f35b5a9f413a950702
F test/autovacuum.test a87871f29761093dc171e97c9d0dd5ae7d43b0d1
F test/autovacuum_crash.test 05a63b8805b20cfba7ace82856ce4ccdda075a31
F test/autovacuum_ioerr.test 9cf27275ca47b72e188a47c53b61b6d583a01d24
F test/autovacuum_ioerr2.test c4c8943eebf5051f773ec9739461318f057e5c15
@ -108,9 +108,9 @@ F test/capi2.test b0e12aa66684424869f899b421ff71df69411998
F test/capi3.test ffb8bd785d5fe26e5d63f24c189c45f21297d44f
F test/capi3b.test 5b6a66f9f295f79f443b5d3f33187fa5ef6cf336
F test/collate1.test f79736d2ebf5492167ee4d1f4ab4c09dda776b03
F test/collate2.test 12fd658d8f5106a8a5c8a77d66919d8c89394036
F test/collate2.test 224a632ba04907c049804b08162efd234aa7871f
F test/collate3.test a5ff693872a915fc6267956673d20915485c1829
F test/collate4.test 2d6e38e6b871073313f6d4eebfe1435c7173ebfa
F test/collate4.test b8668612691c4dcf90f67a8df1eeb1544e7fdaf8
F test/collate5.test 7999fb3122386bae38acd8ccd61e0b7c5a30e289
F test/collate6.test 6c9470d1606ee3e564675b229653e320c49ec638
F test/conflict.test c5b849b01cfbe0a4f63a90cba6f68e2fe3a75f87
@ -126,26 +126,26 @@ F test/diskfull.test e2f6cfd868713ead06dc82b84a4938e868128fc0
F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52
F test/enc2.test 6d1a2650e9da43eab499d18ca694a0cb6ec69dee
F test/enc3.test f6a5f0b7b7f3a88f030d3143729b87cd5c86d837
F test/expr.test 7baf931302bc81352d20cfc0cd7b2a26bf54e73e
F test/expr.test b2ce68f4b3298dd06867468b770ca2604068014e
F test/fkey1.test 81bb13caaa78f58d7d191d7f535529f7c91d821a
F test/func.test 47443316dfc7f78f173b207e35d63caeab42b7fe
F test/hook.test f8605cde4c77b2c6a4a73723bf6c507796a64dda
F test/in.test b92a2df9162e1cbd33c6449a29a05e6955b1741a
F test/index.test 1294997b4743007af57f8148c63ba14f07ad31ab
F test/in.test ed134f8d477a6280297ced1646de83cccf8f196d
F test/index.test 51e01a0928b4b61228917ddd8c6c0e2466547f6f
F test/index2.test 9ad98243fd7fe833795a9cc662f371f0eed4ff4f
F test/insert.test b18db896ff0b030224c586807390c9a6565ef5d4
F test/insert2.test 0bb50ff999e35a21549d8ee5dc44db8ac24d31a7
F test/insert.test f39cb2306199c6f9d8959b843c9199d799217055
F test/insert2.test 420cb5c23912732219aad87420abdd7b994b1cad
F test/insert3.test fa7cb5b01709a1bca3e28c82c80c1d44386b3676
F test/interrupt.test 5b4d8389e6cf2d01b94f87cfd02d9df1073bfb2d
F test/intpkey.test b57cf5236fde1bd8cbc1388fa0c91908f6fd9194
F test/ioerr.test fb507c2596bb07aeaff257cb48fcc93340159f0c
F test/join.test 59e5abff5965016e3c75996f1019e2e91664647f
F test/join2.test c97e4c5aa65dea462145529e58212a709b4722b8
F test/join.test a61c9328ef0b2b573e1ea803882cb947b870d131
F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
F test/join4.test 8dec387d06b3a4685e1104048065cf5236b99b93
F test/join4.test cc6cafe85e11aacacd0abcd247a46bed251308f8
F test/lastinsert.test b6a1db3e1ce2d3f0d6afe99d445084f543b6feaa
F test/laststmtchanges.test 07cbdabc52407c29e40abc25050f2434f044a6b1
F test/limit.test 56101a4533905e1a2692bba1b23882c3e0dbb8f1
F test/limit.test 9913f3cc797841098209e09f9fb259e5198ad2da
F test/lock.test a19aab9a963273fe61c1058e3d1b648d6a0a2425
F test/lock2.test 59c3dd7d9b24d1bf7ec91b2d1541c37e97939d5f
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
@ -153,14 +153,14 @@ F test/main.test a60a1d234b5f5784097973bd395514ca56003ef1
F test/malloc.test 180f7f7e19aca748ec923ab4ada6a2976b781722
F test/memdb.test 532aac7128a3da494cddc4461d76c6e3988f771b
F test/memleak.test c0af09191af44a7501ec2494fdd079ac538a256c
F test/minmax.test e7048476940df0af11d0f2cf687572f557cd0b29
F test/misc1.test 744f60d1025fa978708b96cb222a07a1feb1524a
F test/minmax.test b723a302c8c9bfa9fa417ba6f2f43c663bd8479e
F test/misc1.test e4d9edd525d859932ac70d3fad60fa1303c6f6e5
F test/misc2.test 51f45f56af2d7d38238dc3d38eeb6342a2f4bb09
F test/misc3.test 928a2f1e1189924ed14e1ae074e34f40688bdf94
F test/misc4.test e32ca4d6915ef4ad910f41bae3a8927fdf61373c
F test/misc3.test 7bd937e2c62bcc6be71939faf068d506467b1e03
F test/misc4.test 145e301fdf10bd47059132db932523814201dc2a
F test/misuse.test 600738a8e611989bc5f544303f5e311c5f228084
F test/notnull.test 7a08117a71e74b0321aaa937dbeb41a09d6eb1d0
F test/null.test 5a945790ef21b24fd602fe2c7a23847b903f8687
F test/null.test 69c62daf1630bf54c87bbc7ef2e22012e58d6da8
F test/pager.test f78a03ab8f9f64db47101e4957ac16a3a5563317
F test/pager2.test 49c0f57c7da0b060f0486b85fdd074025caa694e
F test/pager3.test 647f696a9cf7409df00a1e0047c2eb55585a1b85
@ -172,23 +172,23 @@ F test/quick.test 91e5b8ae6663dc9e3e754b271f0384f0cae706e6
F test/quote.test 6d75cf635d93ba2484dc9cb378d88cbae9dc2c62
F test/reindex.test 3552c6b944a3fab28cfd3049c04c65cb79419757
F test/rollback.test 94cd981ee3a627d9f6466f69dcf1f7dbfe695d7a
F test/rowid.test 1ce3f1520d2082b0363e7d9bdef904cb72b9efe8
F test/rowid.test 040a3bef06f970c45f5fcd14b2355f7f4d62f0cf
F test/safety.test 907b64fee719554a3622853812af3886fddbbb4f
F test/select1.test 6d4a42c2fb7fca7196435d6bc90aac5b180e8d94
F test/select1.test bb62bfcd4f3cbba385185d0c0929c3408c43b00a
F test/select2.test 91a2225926039b0d1687840735c284dbbf89f0bc
F test/select3.test 9de435aa84fc406708cd8dc1b1d60e7f27cea685
F test/select4.test 1ae6f2bd6177d4428df8644eb95d09f4568fb149
F test/select5.test 94db800bbeff2e426c0175e07f7a71d4617853b5
F test/select6.test c00d300d90f0ae3fa4e4f4336c71b2345bfa819c
F test/select7.test f567a61c3a8a91bdbb376c4525caec3fa0ea8cea
F test/select6.test ba1b4dd18a85bf9070c6df8d933ac4cfcacea6a6
F test/select7.test 63fb77d50f4dfdac4d4115842f083d2eb33a198c
F test/sort.test 87882e6c72a75d45e98a1c802c1ded0eac557d85
F test/subquery.test 34ee5ea73751f880e4d9af9149bd9e14156347ae
F test/subselect.test ff3850d0aab1443dafa4ecbdab1d01e58e7b366d
F test/table.test b8b0bee2ac2f3d36a674bc68344c1bdd80e99a18
F test/tableapi.test b21ab097e87a5484bb61029e69e1a4e5c5e65ede
F test/subselect.test 3f3f7a940dc3195c3139f4d530385cb54665d614
F test/table.test a6b6b897731b4971f06db165d65bd608a9f2d461
F test/tableapi.test 6a66d58b37d46dc0f2b3c7d4bd2617d209399bd1
F test/tclsqlite.test f467d9062e17c1ace54467e6fba5ce3ca176c0fe
F test/temptable.test 63a16e3ad19adf073cfbcdf7624c92ac5236522c
F test/tester.tcl 48bf84ac713c57177685d2ba1ad5b823b80b0f49
F test/tester.tcl 0e9e3697983873ebd58aeefa61a87de2bc2c56ae
F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
F test/threadtest2.c 97a830d53c24c42290501fdfba4a6e5bdd34748b
@ -201,14 +201,14 @@ F test/trigger4.test e7c0812b14750754602468f15495260e8c6625e0
F test/trigger5.test 619391a3e9fc194081d22cefd830d811e7badf83
F test/trigger6.test 88b4c0c9f67e4244af39627538526bbaf97132f5
F test/types.test f0a98d10c5ecc9865d19dc94486f9873afc6bb6b
F test/types2.test f23c147a2ab3e51d5dbcfa9987200db5acba7aa7
F test/types2.test 81dd1897be8ef4b5b73d0006e6076abe40610de3
F test/unique.test 0e38d4cc7affeef2527720d1dafd1f6870f02f2b
F test/update.test 5d9b7451c991f24f64e0955595be4bc449c1017d
F test/update.test 7669ca789d62c258b678e8aa7a22a57eac10f2cf
F test/utf16.test 459c2f5ab80c60092c603630a348c32d6e59c558
F test/vacuum.test f18eccdee5b538d46298c64d6a060cfbf97bbc23
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/view.test 3f96df86f1c61ee850b945204683773bbbb8643e
F test/where.test 0d7c9dad0aabb30aa8babdee659cc558db85a274
F test/where.test ffb790dfda75d977bae7a1f5830351623f76861b
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/lemon.c eb3b2bbefc0d442fa459f4f1924e598e804eca9c
F tool/lempar.c 1e61d2b6cb9d8affa264a13336bc0c088498caa4
@ -271,7 +271,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
P 06887afb323fa1fb6988a136f96a456467cf7b2f
R db55597e35dc9a9288564c0678d66f41
U drh
Z 9ca18e5fa8587d49ad6cdd58c232af3c
P de8ee3a29e1aafcfa05841cb44da0a05f0579596
R 617b6e607d17d790bf84f6e775c7d625
U danielk1977
Z 3efedbe6a0ea0314bb3302f4acfcc917

View File

@ -1 +1 @@
de8ee3a29e1aafcfa05841cb44da0a05f0579596
bb0254ab14417f0ab40f10f37cb63a60507f070a

View File

@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.161 2005/01/20 13:36:20 drh Exp $
** @(#) $Id: parse.y,v 1.162 2005/01/21 03:12:15 danielk1977 Exp $
*/
%token_prefix TK_
%token_type {Token}
@ -705,16 +705,16 @@ expr(A) ::= expr(W) between_op(N) expr(X) AND expr(Y). [BETWEEN] {
if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
sqlite3ExprSpan(A,&W->span,&Y->span);
}
%type in_op {int}
in_op(A) ::= IN. {A = 0;}
in_op(A) ::= NOT IN. {A = 1;}
expr(A) ::= expr(X) in_op(N) LP exprlist(Y) RP(E). [IN] {
A = sqlite3Expr(TK_IN, X, 0, 0);
if( A ) A->pList = Y;
if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
sqlite3ExprSpan(A,&X->span,&E);
}
%ifndef SQLITE_OMIT_SUBQUERY
%type in_op {int}
in_op(A) ::= IN. {A = 0;}
in_op(A) ::= NOT IN. {A = 1;}
expr(A) ::= expr(X) in_op(N) LP exprlist(Y) RP(E). [IN] {
A = sqlite3Expr(TK_IN, X, 0, 0);
if( A ) A->pList = Y;
if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
sqlite3ExprSpan(A,&X->span,&E);
}
expr(A) ::= LP(B) select(X) RP(E). {
A = sqlite3Expr(TK_SELECT, 0, 0, 0);
if( A ) A->pSelect = X;

View File

@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.359 2005/01/20 13:36:20 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.360 2005/01/21 03:12:15 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@ -110,7 +110,7 @@
** a minimum.
*/
/* #define SQLITE_OMIT_AUTHORIZATION 1 */
/* #define SQLITE_OMIT_INMEMORYDB 1 */
/* #define SQLITE_OMIT_MEMORYDB 1 */
/* #define SQLITE_OMIT_VACUUM 1 */
/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */
/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */

View File

@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
** $Id: test1.c,v 1.124 2005/01/20 01:14:23 danielk1977 Exp $
** $Id: test1.c,v 1.125 2005/01/21 03:12:16 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@ -2734,6 +2734,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
#endif
#ifdef SQLITE_OMIT_SUBQUERY
Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY);
#endif
#ifdef SQLITE_OMIT_TCL_VARIABLE
Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY);
#else

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement.
#
# $Id: autovacuum.test,v 1.14 2005/01/15 12:45:51 danielk1977 Exp $
# $Id: autovacuum.test,v 1.15 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -95,7 +95,7 @@ foreach delete_order $delete_orders {
# Delete one set of rows from the table.
do_test autovacuum-1.$tn.($delete).1 {
execsql "
DELETE FROM av1 WHERE oid IN ([join $delete ,])
DELETE FROM av1 WHERE oid = [join $delete "OR oid = "]
"
} {}

View File

@ -12,7 +12,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is page cache subsystem.
#
# $Id: collate2.test,v 1.3 2004/09/19 02:15:26 drh Exp $
# $Id: collate2.test,v 1.4 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -204,39 +204,42 @@ do_test collate2-1.21 {
ORDER BY 1, oid;
}
} {aa}
do_test collate2-1.22 {
execsql {
SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa bb}
do_test collate2-1.23 {
execsql {
SELECT b FROM collate2t1 WHERE b IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa aA Aa AA bb bB Bb BB}
do_test collate2-1.24 {
execsql {
SELECT c FROM collate2t1 WHERE c IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa bb}
do_test collate2-1.25 {
execsql {
SELECT a FROM collate2t1
WHERE a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb}
do_test collate2-1.26 {
execsql {
SELECT b FROM collate2t1
WHERE b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb aA bB Aa Bb AA BB}
do_test collate2-1.27 {
execsql {
SELECT c FROM collate2t1
WHERE c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb}
ifcapable subquery {
do_test collate2-1.22 {
execsql {
SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa bb}
do_test collate2-1.23 {
execsql {
SELECT b FROM collate2t1 WHERE b IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa aA Aa AA bb bB Bb BB}
do_test collate2-1.24 {
execsql {
SELECT c FROM collate2t1 WHERE c IN ('aa', 'bb') ORDER BY 1, oid;
}
} {aa bb}
do_test collate2-1.25 {
execsql {
SELECT a FROM collate2t1
WHERE a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb}
do_test collate2-1.26 {
execsql {
SELECT b FROM collate2t1
WHERE b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb aA bB Aa Bb AA BB}
do_test collate2-1.27 {
execsql {
SELECT c FROM collate2t1
WHERE c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {aa bb}
} ;# ifcapable subquery
do_test collate2-2.1 {
execsql {
@ -343,39 +346,42 @@ do_test collate2-2.21 {
SELECT c FROM collate2t1 WHERE NOT CASE c WHEN 'aa' THEN 1 ELSE 0 END;
}
} {{} ab ba bb aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.22 {
execsql {
SELECT a FROM collate2t1 WHERE NOT a IN ('aa', 'bb');
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.23 {
execsql {
SELECT b FROM collate2t1 WHERE NOT b IN ('aa', 'bb');
}
} {ab ba aB bA Ab Ba AB BA}
do_test collate2-2.24 {
execsql {
SELECT c FROM collate2t1 WHERE NOT c IN ('aa', 'bb');
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.25 {
execsql {
SELECT a FROM collate2t1
WHERE NOT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.26 {
execsql {
SELECT b FROM collate2t1
WHERE NOT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aB bA Ab Ba AB BA}
do_test collate2-2.27 {
execsql {
SELECT c FROM collate2t1
WHERE NOT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
ifcapable subquery {
do_test collate2-2.22 {
execsql {
SELECT a FROM collate2t1 WHERE NOT a IN ('aa', 'bb');
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.23 {
execsql {
SELECT b FROM collate2t1 WHERE NOT b IN ('aa', 'bb');
}
} {ab ba aB bA Ab Ba AB BA}
do_test collate2-2.24 {
execsql {
SELECT c FROM collate2t1 WHERE NOT c IN ('aa', 'bb');
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.25 {
execsql {
SELECT a FROM collate2t1
WHERE NOT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
do_test collate2-2.26 {
execsql {
SELECT b FROM collate2t1
WHERE NOT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aB bA Ab Ba AB BA}
do_test collate2-2.27 {
execsql {
SELECT c FROM collate2t1
WHERE NOT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
}
} {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB}
}
do_test collate2-3.1 {
execsql {
@ -482,39 +488,42 @@ do_test collate2-3.21 {
SELECT CASE c WHEN 'aa' THEN 1 ELSE 0 END FROM collate2t1;
}
} {0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.22 {
execsql {
SELECT a IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.23 {
execsql {
SELECT b IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1}
do_test collate2-3.24 {
execsql {
SELECT c IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.25 {
execsql {
SELECT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.26 {
execsql {
SELECT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1}
do_test collate2-3.27 {
execsql {
SELECT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
ifcapable subquery {
do_test collate2-3.22 {
execsql {
SELECT a IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.23 {
execsql {
SELECT b IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1}
do_test collate2-3.24 {
execsql {
SELECT c IN ('aa', 'bb') FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.25 {
execsql {
SELECT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
do_test collate2-3.26 {
execsql {
SELECT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1}
do_test collate2-3.27 {
execsql {
SELECT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'))
FROM collate2t1;
}
} {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0}
}
do_test collate2-4.0 {
execsql {

View File

@ -12,7 +12,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is page cache subsystem.
#
# $Id: collate4.test,v 1.6 2004/12/19 00:11:36 drh Exp $
# $Id: collate4.test,v 1.7 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -371,34 +371,36 @@ do_test collate4-2.1.5 {
SELECT * FROM collate4t2, collate4t1 WHERE b = a;
}
} {A A 4}
do_test collate4-2.1.6 {
count {
SELECT a FROM collate4t1 WHERE a IN (SELECT * FROM collate4t2);
}
} {a A 10}
do_test collate4-2.1.7 {
execsql {
DROP INDEX collate4i1;
CREATE INDEX collate4i1 ON collate4t1(a);
}
count {
SELECT a FROM collate4t1 WHERE a IN (SELECT * FROM collate4t2);
}
} {a A 6}
do_test collate4-2.1.8 {
count {
SELECT a FROM collate4t1 WHERE a IN ('z', 'a');
}
} {a A 5}
do_test collate4-2.1.9 {
execsql {
DROP INDEX collate4i1;
CREATE INDEX collate4i1 ON collate4t1(a COLLATE TEXT);
}
count {
SELECT a FROM collate4t1 WHERE a IN ('z', 'a');
}
} {a A 9}
ifcapable subquery {
do_test collate4-2.1.6 {
count {
SELECT a FROM collate4t1 WHERE a IN (SELECT * FROM collate4t2);
}
} {a A 10}
do_test collate4-2.1.7 {
execsql {
DROP INDEX collate4i1;
CREATE INDEX collate4i1 ON collate4t1(a);
}
count {
SELECT a FROM collate4t1 WHERE a IN (SELECT * FROM collate4t2);
}
} {a A 6}
do_test collate4-2.1.8 {
count {
SELECT a FROM collate4t1 WHERE a IN ('z', 'a');
}
} {a A 5}
do_test collate4-2.1.9 {
execsql {
DROP INDEX collate4i1;
CREATE INDEX collate4i1 ON collate4t1(a COLLATE TEXT);
}
count {
SELECT a FROM collate4t1 WHERE a IN ('z', 'a');
}
} {a A 9}
}
do_test collate4-2.1.10 {
execsql {
DROP TABLE collate4t1;

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing expressions.
#
# $Id: expr.test,v 1.41 2005/01/11 17:46:42 drh Exp $
# $Id: expr.test,v 1.42 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -500,12 +500,18 @@ test_expr2 expr-7.46 {((123||'xabcdefghijklmnopqrstuvwyxz01234567890'||a) BETWEE
test_expr2 expr-7.50 {((a between 1 and 2 OR 0) AND 1) OR 0} {1 2}
test_expr2 expr-7.51 {((a not between 3 and 100 OR 0) AND 1) OR 0} {1 2}
test_expr2 expr-7.52 {((a in (1,2) OR 0) AND 1) OR 0} {1 2}
test_expr2 expr-7.53 {((a not in (3,4,5,6,7,8,9,10) OR 0) AND a<11) OR 0} {1 2}
ifcapable subquery {
test_expr2 expr-7.52 {((a in (1,2) OR 0) AND 1) OR 0} {1 2}
test_expr2 expr-7.53 \
{((a not in (3,4,5,6,7,8,9,10) OR 0) AND a<11) OR 0} {1 2}
}
test_expr2 expr-7.54 {((a>0 OR 0) AND a<3) OR 0} {1 2}
test_expr2 expr-7.55 {((a in (1,2) OR 0) IS NULL AND 1) OR 0} {{}}
test_expr2 expr-7.56 {((a not in (3,4,5,6,7,8,9,10) IS NULL OR 0) AND 1) OR 0} \
{{}}
ifcapable subquery {
test_expr2 expr-7.55 {((a in (1,2) OR 0) IS NULL AND 1) OR 0} {{}}
test_expr2 expr-7.56 \
{((a not in (3,4,5,6,7,8,9,10) IS NULL OR 0) AND 1) OR 0} {{}}
}
test_expr2 expr-7.57 {((a>0 IS NULL OR 0) AND 1) OR 0} {{}}
test_expr2 expr-7.58 {(a||'')<='1'} {1}

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the IN and BETWEEN operator.
#
# $Id: in.test,v 1.12 2004/05/27 17:22:56 drh Exp $
# $Id: in.test,v 1.13 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -53,6 +53,14 @@ do_test in-1.7 {
execsql {SELECT a+ 100*(a BETWEEN 1 and 3) FROM t1 ORDER BY b}
} {101 102 103 4 5 6 7 8 9 10}
# The rest of this file concentrates on testing the IN operator.
# Skip this if the library is compiled with SQLITE_OMIT_SUBQUERY
# (because the IN operator is unavailable).
#
ifcapable !subquery {
finish_test
return
}
# Testing of the IN operator using static lists on the right-hand side.
#

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the CREATE INDEX statement.
#
# $Id: index.test,v 1.36 2004/11/22 08:43:32 danielk1977 Exp $
# $Id: index.test,v 1.37 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -304,8 +304,12 @@ do_test index-10.4 {
}
} {1 2 3 4 5 6 7 8 9}
do_test index-10.5 {
ifcapable subquery {
execsql { DELETE FROM t1 WHERE b IN (2, 4, 6, 8); }
} else {
execsql { DELETE FROM t1 WHERE b = 2 OR b = 4 OR b = 6 OR b = 8; }
}
execsql {
DELETE FROM t1 WHERE b IN (2, 4, 6, 8);
SELECT b FROM t1 WHERE a=1 ORDER BY b;
}
} {1 3 5 7 9}

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the INSERT statement.
#
# $Id: insert.test,v 1.22 2005/01/17 08:57:09 danielk1977 Exp $
# $Id: insert.test,v 1.23 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -177,20 +177,33 @@ do_test insert-4.1 {
}
} {6 4 5}
do_test insert-4.2 {
ifcapable subquery {
execsql {INSERT INTO t3 VALUES((SELECT max(a) FROM t3)+1,5,6);}
} else {
set maxa [execsql {SELECT max(a) FROM t3}]
execsql "INSERT INTO t3 VALUES($maxa+1,5,6);"
}
execsql {
INSERT INTO t3 VALUES((SELECT max(a) FROM t3)+1,5,6);
SELECT * FROM t3 ORDER BY a;
}
} {6 4 5 7 5 6}
do_test insert-4.3 {
catchsql {
INSERT INTO t3 VALUES((SELECT max(a) FROM t3)+1,t3.a,6);
SELECT * FROM t3 ORDER BY a;
}
} {1 {no such column: t3.a}}
ifcapable subquery {
do_test insert-4.3 {
catchsql {
INSERT INTO t3 VALUES((SELECT max(a) FROM t3)+1,t3.a,6);
SELECT * FROM t3 ORDER BY a;
}
} {1 {no such column: t3.a}}
}
do_test insert-4.4 {
ifcapable subquery {
execsql {INSERT INTO t3 VALUES((SELECT b FROM t3 WHERE a=0),6,7);}
} else {
set b [execsql {SELECT b FROM t3 WHERE a = 0}]
if {$b==""} {set b NULL}
execsql "INSERT INTO t3 VALUES($b,6,7);"
}
execsql {
INSERT INTO t3 VALUES((SELECT b FROM t3 WHERE a=0),6,7);
SELECT * FROM t3 ORDER BY a;
}
} {{} 6 7 6 4 5 7 5 6}

View File

@ -12,7 +12,7 @@
# focus of this file is testing the INSERT statement that takes is
# result from a SELECT.
#
# $Id: insert2.test,v 1.13 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: insert2.test,v 1.14 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -151,14 +151,27 @@ do_test insert2-3.2.1 {
}
} {10}
do_test insert2-3.3 {
execsql {
BEGIN;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
COMMIT;
SELECT count(*) FROM t4;
ifcapable subquery {
execsql {
BEGIN;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
INSERT INTO t4 SELECT x+(SELECT max(x) FROM t4),y FROM t4;
COMMIT;
SELECT count(*) FROM t4;
}
} else {
db function max_x_t4 {execsql {SELECT max(x) FROM t4}}
execsql {
BEGIN;
INSERT INTO t4 SELECT x+max_x_t4() ,y FROM t4;
INSERT INTO t4 SELECT x+max_x_t4() ,y FROM t4;
INSERT INTO t4 SELECT x+max_x_t4() ,y FROM t4;
INSERT INTO t4 SELECT x+max_x_t4() ,y FROM t4;
COMMIT;
SELECT count(*) FROM t4;
}
}
} {160}
do_test insert2-3.4 {
@ -171,11 +184,20 @@ do_test insert2-3.4 {
}
} {160}
do_test insert2-3.5 {
execsql {
BEGIN;
INSERT INTO t4 SELECT x+(SELECT max(x)+1 FROM t4),y FROM t4;
SELECT count(*) from t4;
ROLLBACK;
ifcapable subquery {
execsql {
BEGIN;
INSERT INTO t4 SELECT x+(SELECT max(x)+1 FROM t4),y FROM t4;
SELECT count(*) from t4;
ROLLBACK;
}
} else {
execsql {
BEGIN;
INSERT INTO t4 SELECT x+max_x_t4()+1,y FROM t4;
SELECT count(*) from t4;
ROLLBACK;
}
}
} {320}
do_test insert2-3.6 {

View File

@ -12,7 +12,7 @@
#
# This file implements tests for joins, including outer joins.
#
# $Id: join.test,v 1.15 2005/01/18 17:40:04 drh Exp $
# $Id: join.test,v 1.16 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -117,18 +117,21 @@ do_test join-1.12 {
SELECT * FROM t1 natural inner join t2;
}
} {1 2 3 4 2 3 4 5}
do_test join-1.13 {
execsql2 {
SELECT * FROM t1 NATURAL JOIN
(SELECT b as 'c', c as 'd', d as 'e' FROM t2) as t3
}
} {a 1 b 2 c 3 d 4 e 5}
do_test join-1.14 {
execsql2 {
SELECT * FROM (SELECT b as 'c', c as 'd', d as 'e' FROM t2) as 'tx'
NATURAL JOIN t1
}
} {c 3 d 4 e 5 a 1 b 2}
ifcapable subquery {
do_test join-1.13 {
execsql2 {
SELECT * FROM t1 NATURAL JOIN
(SELECT b as 'c', c as 'd', d as 'e' FROM t2) as t3
}
} {a 1 b 2 c 3 d 4 e 5}
do_test join-1.14 {
execsql2 {
SELECT * FROM (SELECT b as 'c', c as 'd', d as 'e' FROM t2) as 'tx'
NATURAL JOIN t1
}
} {c 3 d 4 e 5 a 1 b 2}
}
do_test join-1.15 {
execsql {

View File

@ -12,7 +12,7 @@
#
# This file implements tests for joins, including outer joins.
#
# $Id: join2.test,v 1.1 2004/01/24 20:18:13 drh Exp $
# $Id: join2.test,v 1.2 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -63,11 +63,13 @@ do_test join2-1.6 {
t1 NATURAL LEFT OUTER JOIN t2 NATURAL JOIN t3
}
} {1 11 111 1111}
do_test join2-1.6 {
execsql {
SELECT * FROM
t1 NATURAL LEFT OUTER JOIN (t2 NATURAL JOIN t3)
}
} {1 11 111 1111 2 22 {} {} 3 33 {} {}}
ifcapable subquery {
do_test join2-1.7 {
execsql {
SELECT * FROM
t1 NATURAL LEFT OUTER JOIN (t2 NATURAL JOIN t3)
}
} {1 11 111 1111 2 22 {} {} 3 33 {} {}}
}
finish_test

View File

@ -13,7 +13,7 @@
# This file implements tests for left outer joins containing WHERE
# clauses that restrict the scope of the left term of the join.
#
# $Id: join4.test,v 1.2 2004/07/19 19:28:44 drh Exp $
# $Id: join4.test,v 1.3 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -62,16 +62,18 @@ do_test join4-1.4 {
select * from t1 left outer join t2 on t1.a=t2.x and t2.z>='ok'
}
} {1 one {} {} {} 2 two 2 niban ok 3 three {} {} {} 4 four {} {} {}}
do_test join4-1.6 {
execsql {
select * from t1 left outer join t2 on t1.a=t2.x where t2.z IN ('ok')
}
} {2 two 2 niban ok}
do_test join4-1.7 {
execsql {
select * from t1 left outer join t2 on t1.a=t2.x and t2.z IN ('ok')
}
} {1 one {} {} {} 2 two 2 niban ok 3 three {} {} {} 4 four {} {} {}}
ifcapable subquery {
do_test join4-1.6 {
execsql {
select * from t1 left outer join t2 on t1.a=t2.x where t2.z IN ('ok')
}
} {2 two 2 niban ok}
do_test join4-1.7 {
execsql {
select * from t1 left outer join t2 on t1.a=t2.x and t2.z IN ('ok')
}
} {1 one {} {} {} 2 two 2 niban ok 3 three {} {} {} 4 four {} {} {}}
}
finish_test

View File

@ -12,7 +12,7 @@
# focus of this file is testing the LIMIT ... OFFSET ... clause
# of SELECT statements.
#
# $Id: limit.test,v 1.21 2005/01/20 02:17:02 danielk1977 Exp $
# $Id: limit.test,v 1.22 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -79,36 +79,56 @@ do_test limit-2.2 {
SELECT count(*) FROM t2;
}
} 2
do_test limit-2.3 {
execsql {
SELECT count(*) FROM t1 WHERE rowid IN (SELECT rowid FROM t1 LIMIT 2);
}
} 2
ifcapable subquery {
do_test limit-2.3 {
execsql {
SELECT count(*) FROM t1 WHERE rowid IN (SELECT rowid FROM t1 LIMIT 2);
}
} 2
}
do_test limit-3.1 {
execsql {
SELECT z FROM (SELECT y*10+x AS z FROM t1 ORDER BY x LIMIT 10)
ORDER BY z LIMIT 5;
}
} {50 51 52 53 54}
ifcapable subquery {
do_test limit-3.1 {
execsql {
SELECT z FROM (SELECT y*10+x AS z FROM t1 ORDER BY x LIMIT 10)
ORDER BY z LIMIT 5;
}
} {50 51 52 53 54}
}
do_test limit-4.1 {
execsql {
BEGIN;
CREATE TABLE t3(x);
INSERT INTO t3 SELECT x FROM t1 ORDER BY x LIMIT 10 OFFSET 1;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
END;
SELECT count(*) FROM t3;
ifcapable subquery {
execsql {
BEGIN;
CREATE TABLE t3(x);
INSERT INTO t3 SELECT x FROM t1 ORDER BY x LIMIT 10 OFFSET 1;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
INSERT INTO t3 SELECT x+(SELECT max(x) FROM t3) FROM t3;
END;
SELECT count(*) FROM t3;
}
} else {
execsql {
BEGIN;
CREATE TABLE t3(x);
INSERT INTO t3 SELECT x FROM t1 ORDER BY x LIMIT 10 OFFSET 1;
}
for {set i 0} {$i<10} {incr i} {
set max_x_t3 [execsql {SELECT max(x) FROM t3}]
execsql "INSERT INTO t3 SELECT x+$max_x_t3 FROM t3;"
}
execsql {
END;
SELECT count(*) FROM t3;
}
}
} {10240}
do_test limit-4.2 {
@ -320,35 +340,45 @@ do_test limit-8.3 {
# Make sure limits on multiple subqueries work correctly.
# Ticket #1035
#
do_test limit-9.1 {
execsql {
SELECT * FROM (SELECT * FROM t6 LIMIT 3);
}
} {1 2 3}
do_test limit-9.2 {
execsql {
CREATE TABLE t7 AS SELECT * FROM t6;
SELECT * FROM (SELECT * FROM t7 LIMIT 3);
}
} {1 2 3}
ifcapable compound {
do_test limit-9.3 {
ifcapable subquery {
do_test limit-9.1 {
execsql {
SELECT * FROM (SELECT * FROM t6 LIMIT 3)
UNION
SELECT * FROM (SELECT * FROM t7 LIMIT 3)
ORDER BY 1
SELECT * FROM (SELECT * FROM t6 LIMIT 3);
}
} {1 2 3}
do_test limit-9.4 {
}
do_test limit-9.2.1 {
execsql {
CREATE TABLE t7 AS SELECT * FROM t6;
}
} {}
ifcapable subquery {
do_test limit-9.2.2 {
execsql {
SELECT * FROM (SELECT * FROM t6 LIMIT 3)
UNION
SELECT * FROM (SELECT * FROM t7 LIMIT 3)
ORDER BY 1
LIMIT 2
SELECT * FROM (SELECT * FROM t7 LIMIT 3);
}
} {1 2}
} {1 2 3}
}
ifcapable compound {
ifcapable subquery {
do_test limit-9.3 {
execsql {
SELECT * FROM (SELECT * FROM t6 LIMIT 3)
UNION
SELECT * FROM (SELECT * FROM t7 LIMIT 3)
ORDER BY 1
}
} {1 2 3}
do_test limit-9.4 {
execsql {
SELECT * FROM (SELECT * FROM t6 LIMIT 3)
UNION
SELECT * FROM (SELECT * FROM t7 LIMIT 3)
ORDER BY 1
LIMIT 2
}
} {1 2}
}
do_test limit-9.5 {
catchsql {
SELECT * FROM t6 LIMIT 3

View File

@ -13,7 +13,7 @@
# aggregate min() and max() functions and which are handled as
# as a special case.
#
# $Id: minmax.test,v 1.14 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: minmax.test,v 1.15 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -104,7 +104,12 @@ do_test minmax-2.3 {
} {0}
do_test minmax-3.0 {
execsql {INSERT INTO t2 VALUES((SELECT max(a) FROM t2)+1,999)}
ifcapable subquery {
execsql {INSERT INTO t2 VALUES((SELECT max(a) FROM t2)+1,999)}
} else {
db function max_a_t2 {execsql {SELECT max(a) FROM t2}}
execsql {INSERT INTO t2 VALUES(max_a_t2()+1,999)}
}
set sqlite_search_count 0
execsql {SELECT max(a) FROM t2}
} {21}
@ -112,10 +117,17 @@ do_test minmax-3.1 {
set sqlite_search_count
} {0}
do_test minmax-3.2 {
execsql {INSERT INTO t2 VALUES((SELECT max(a) FROM t2)+1,999)}
ifcapable subquery {
execsql {INSERT INTO t2 VALUES((SELECT max(a) FROM t2)+1,999)}
} else {
db function max_a_t2 {execsql {SELECT max(a) FROM t2}}
execsql {INSERT INTO t2 VALUES(max_a_t2()+1,999)}
}
set sqlite_search_count 0
execsql {
SELECT b FROM t2 WHERE a=(SELECT max(a) FROM t2)
ifcapable subquery {
execsql { SELECT b FROM t2 WHERE a=(SELECT max(a) FROM t2) }
} else {
execsql { SELECT b FROM t2 WHERE a=max_a_t2() }
}
} {999}
do_test minmax-3.3 {
@ -222,21 +234,25 @@ do_test minmax-7.1 {
SELECT max(x) FROM t1;
}
} 20
do_test minmax-7.2 {
execsql {
SELECT * FROM (SELECT max(x) FROM t1);
}
} 20
ifcapable subquery {
do_test minmax-7.2 {
execsql {
SELECT * FROM (SELECT max(x) FROM t1);
}
} 20
}
do_test minmax-7.3 {
execsql {
SELECT min(x) FROM t1;
}
} 1
do_test minmax-7.4 {
execsql {
SELECT * FROM (SELECT min(x) FROM t1);
}
} 1
ifcapable subquery {
do_test minmax-7.4 {
execsql {
SELECT * FROM (SELECT min(x) FROM t1);
}
} 1
}
# Make sure min(x) and max(x) work correctly when the datatype is
# TEXT instead of NUMERIC. Ticket #623.
@ -319,11 +335,13 @@ do_test minmax-10.6 {
SELECT count(x) FROM t6;
}
} 0
do_test minmax-10.7 {
execsql {
SELECT (SELECT min(x) FROM t6), (SELECT max(x) FROM t6);
}
} {{} {}}
ifcapable subquery {
do_test minmax-10.7 {
execsql {
SELECT (SELECT min(x) FROM t6), (SELECT max(x) FROM t6);
}
} {{} {}}
}
do_test minmax-10.8 {
execsql {
SELECT min(x), max(x) FROM t6;
@ -349,11 +367,13 @@ do_test minmax-10.10 {
SELECT count(x) FROM t6;
}
} 0
do_test minmax-10.11 {
execsql {
SELECT (SELECT min(x) FROM t6), (SELECT max(x) FROM t6);
}
} {{} {}}
ifcapable subquery {
do_test minmax-10.11 {
execsql {
SELECT (SELECT min(x) FROM t6), (SELECT max(x) FROM t6);
}
} {{} {}}
}
do_test minmax-10.12 {
execsql {
SELECT min(x), max(x) FROM t6;

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc1.test,v 1.31 2004/11/04 04:42:28 drh Exp $
# $Id: misc1.test,v 1.32 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -431,38 +431,40 @@ do_test misc1-12.13 {
# the old copy of the buffer were not being moved over to the new copy.
# The following code tests for the problem.
#
do_test misc1-13.1 {
execsql {
CREATE TABLE t9(x,y);
INSERT INTO t9 VALUES('one',1);
INSERT INTO t9 VALUES('two',2);
INSERT INTO t9 VALUES('three',3);
INSERT INTO t9 VALUES('four',4);
INSERT INTO t9 VALUES('five',5);
INSERT INTO t9 VALUES('six',6);
INSERT INTO t9 VALUES('seven',7);
INSERT INTO t9 VALUES('eight',8);
INSERT INTO t9 VALUES('nine',9);
INSERT INTO t9 VALUES('ten',10);
INSERT INTO t9 VALUES('eleven',11);
SELECT y FROM t9
WHERE x=(SELECT x FROM t9 WHERE y=1)
OR x=(SELECT x FROM t9 WHERE y=2)
OR x=(SELECT x FROM t9 WHERE y=3)
OR x=(SELECT x FROM t9 WHERE y=4)
OR x=(SELECT x FROM t9 WHERE y=5)
OR x=(SELECT x FROM t9 WHERE y=6)
OR x=(SELECT x FROM t9 WHERE y=7)
OR x=(SELECT x FROM t9 WHERE y=8)
OR x=(SELECT x FROM t9 WHERE y=9)
OR x=(SELECT x FROM t9 WHERE y=10)
OR x=(SELECT x FROM t9 WHERE y=11)
OR x=(SELECT x FROM t9 WHERE y=12)
OR x=(SELECT x FROM t9 WHERE y=13)
OR x=(SELECT x FROM t9 WHERE y=14)
;
}
} {1 2 3 4 5 6 7 8 9 10 11}
ifcapable subquery {
do_test misc1-13.1 {
execsql {
CREATE TABLE t9(x,y);
INSERT INTO t9 VALUES('one',1);
INSERT INTO t9 VALUES('two',2);
INSERT INTO t9 VALUES('three',3);
INSERT INTO t9 VALUES('four',4);
INSERT INTO t9 VALUES('five',5);
INSERT INTO t9 VALUES('six',6);
INSERT INTO t9 VALUES('seven',7);
INSERT INTO t9 VALUES('eight',8);
INSERT INTO t9 VALUES('nine',9);
INSERT INTO t9 VALUES('ten',10);
INSERT INTO t9 VALUES('eleven',11);
SELECT y FROM t9
WHERE x=(SELECT x FROM t9 WHERE y=1)
OR x=(SELECT x FROM t9 WHERE y=2)
OR x=(SELECT x FROM t9 WHERE y=3)
OR x=(SELECT x FROM t9 WHERE y=4)
OR x=(SELECT x FROM t9 WHERE y=5)
OR x=(SELECT x FROM t9 WHERE y=6)
OR x=(SELECT x FROM t9 WHERE y=7)
OR x=(SELECT x FROM t9 WHERE y=8)
OR x=(SELECT x FROM t9 WHERE y=9)
OR x=(SELECT x FROM t9 WHERE y=10)
OR x=(SELECT x FROM t9 WHERE y=11)
OR x=(SELECT x FROM t9 WHERE y=12)
OR x=(SELECT x FROM t9 WHERE y=13)
OR x=(SELECT x FROM t9 WHERE y=14)
;
}
} {1 2 3 4 5 6 7 8 9 10 11}
}
# Make sure a database connection still works after changing the
# working directory.

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc3.test,v 1.15 2004/11/04 14:47:13 drh Exp $
# $Id: misc3.test,v 1.16 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -199,45 +199,49 @@ do_test misc3-4.1 {
SELECT count(a), count(b) FROM t3;
}
} {128 64}
ifcapable subquery {
do_test misc3-4.2 {
execsql {
SELECT count(a) FROM t3 WHERE b IN (SELECT b FROM t3);
}
} {64}
do_test misc3-4.3 {
execsql {
SELECT count(a) FROM t3 WHERE b IN (SELECT b FROM t3 ORDER BY a+1);
}
} {64}
execsql {
SELECT count(a) FROM t3 WHERE b IN (SELECT b FROM t3);
}
} {64}
do_test misc3-4.3 {
execsql {
SELECT count(a) FROM t3 WHERE b IN (SELECT b FROM t3 ORDER BY a+1);
}
} {64}
}
# Ticket #601: Putting a left join inside "SELECT * FROM (<join-here>)"
# gives different results that if the outer "SELECT * FROM ..." is omitted.
#
do_test misc3-5.1 {
execsql {
CREATE TABLE x1 (b, c);
INSERT INTO x1 VALUES('dog',3);
INSERT INTO x1 VALUES('cat',1);
INSERT INTO x1 VALUES('dog',4);
CREATE TABLE x2 (c, e);
INSERT INTO x2 VALUES(1,'one');
INSERT INTO x2 VALUES(2,'two');
INSERT INTO x2 VALUES(3,'three');
INSERT INTO x2 VALUES(4,'four');
SELECT x2.c AS c, e, b FROM x2 LEFT JOIN
(SELECT b, max(c)+0 AS c FROM x1 GROUP BY b)
USING(c);
}
} {1 one cat 2 two {} 3 three {} 4 four dog}
do_test misc4-5.2 {
execsql {
SELECT * FROM (
ifcapable subquery {
do_test misc3-5.1 {
execsql {
CREATE TABLE x1 (b, c);
INSERT INTO x1 VALUES('dog',3);
INSERT INTO x1 VALUES('cat',1);
INSERT INTO x1 VALUES('dog',4);
CREATE TABLE x2 (c, e);
INSERT INTO x2 VALUES(1,'one');
INSERT INTO x2 VALUES(2,'two');
INSERT INTO x2 VALUES(3,'three');
INSERT INTO x2 VALUES(4,'four');
SELECT x2.c AS c, e, b FROM x2 LEFT JOIN
(SELECT b, max(c)+0 AS c FROM x1 GROUP BY b)
USING(c)
);
}
} {1 one cat 2 two {} 3 three {} 4 four dog}
USING(c);
}
} {1 one cat 2 two {} 3 three {} 4 four dog}
do_test misc3-5.2 {
execsql {
SELECT * FROM (
SELECT x2.c AS c, e, b FROM x2 LEFT JOIN
(SELECT b, max(c)+0 AS c FROM x1 GROUP BY b)
USING(c)
);
}
} {1 one cat 2 two {} 3 three {} 4 four dog}
}
ifcapable {explain} {
# Ticket #626: make sure EXPLAIN prevents BEGIN and COMMIT from working.
@ -297,15 +301,17 @@ do_test misc3-7.3 {
# of an IN expression is NULL and the result is used as an integer, not
# as a jump.
#
do_test misc-8.1 {
execsql {
SELECT count(CASE WHEN b IN ('abc','xyz') THEN 'x' END) FROM t3
}
} {2}
do_test misc-8.2 {
execsql {
SELECT count(*) FROM t3 WHERE 1+(b IN ('abc','xyz'))==2
}
} {2}
ifcapable subquery {
do_test misc-8.1 {
execsql {
SELECT count(CASE WHEN b IN ('abc','xyz') THEN 'x' END) FROM t3
}
} {2}
do_test misc-8.2 {
execsql {
SELECT count(*) FROM t3 WHERE 1+(b IN ('abc','xyz'))==2
}
} {2}
}
finish_test

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc4.test,v 1.12 2005/01/20 02:17:02 danielk1977 Exp $
# $Id: misc4.test,v 1.13 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -101,23 +101,25 @@ do_test misc4-3.1 {
# Ticket #1047. Make sure column types are preserved in subqueries.
#
do_test misc4-4.1 {
execsql {
create table a(key varchar, data varchar);
create table b(key varchar, period integer);
insert into a values('01','data01');
insert into a values('+1','data+1');
insert into b values ('01',1);
insert into b values ('01',2);
insert into b values ('+1',3);
insert into b values ('+1',4);
select a.*, x.*
from a, (select key,sum(period) from b group by key) as x
where a.key=x.key;
}
} {01 data01 01 3.0 +1 data+1 +1 7.0}
ifcapable subquery {
do_test misc4-4.1 {
execsql {
create table a(key varchar, data varchar);
create table b(key varchar, period integer);
insert into a values('01','data01');
insert into a values('+1','data+1');
insert into b values ('01',1);
insert into b values ('01',2);
insert into b values ('+1',3);
insert into b values ('+1',4);
select a.*, x.*
from a, (select key,sum(period) from b group by key) as x
where a.key=x.key;
}
} {01 data01 01 3.0 +1 data+1 +1 7.0}
}
# Ticket #1036. When creating tables from a SELECT on a view, use the
# short names of columns.

View File

@ -186,11 +186,13 @@ do_test null-8.1 {
SELECT x FROM t4 WHERE y=NULL;
}
} {}
do_test null-8.2 {
execsql {
SELECT x FROM t4 WHERE y IN (33,NULL);
}
} {}
ifcapable subquery {
do_test null-8.2 {
execsql {
SELECT x FROM t4 WHERE y IN (33,NULL);
}
} {}
}
do_test null-8.3 {
execsql {
SELECT x FROM t4 WHERE y<33 ORDER BY x;
@ -212,11 +214,13 @@ do_test null-8.11 {
SELECT x FROM t4 WHERE y=NULL;
}
} {}
do_test null-8.12 {
execsql {
SELECT x FROM t4 WHERE y IN (33,NULL);
}
} {}
ifcapable subquery {
do_test null-8.12 {
execsql {
SELECT x FROM t4 WHERE y IN (33,NULL);
}
} {}
}
do_test null-8.13 {
execsql {
SELECT x FROM t4 WHERE y<33 ORDER BY x;

View File

@ -12,7 +12,7 @@
# focus of this file is testing the magic ROWID column that is
# found on all tables.
#
# $Id: rowid.test,v 1.17 2004/11/04 04:42:28 drh Exp $
# $Id: rowid.test,v 1.18 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -273,8 +273,16 @@ do_test rowid-4.6 {
}
} {4}
do_test rowid-5.1 {
execsql {DELETE FROM t1 WHERE _rowid_ IN (SELECT oid FROM t1 WHERE x>8)}
do_test rowid-5.1.1 {
ifcapable subquery {
execsql {DELETE FROM t1 WHERE _rowid_ IN (SELECT oid FROM t1 WHERE x>8)}
} else {
set oids [execsql {SELECT oid FROM t1 WHERE x>8}]
set where "_rowid_ = [join $oids { OR _rowid_ = }]"
execsql "DELETE FROM t1 WHERE $where"
}
} {}
do_test rowid-5.1.2 {
execsql {SELECT max(x) FROM t1}
} {8}
@ -346,20 +354,23 @@ do_test rowid-7.5 {
SELECT b FROM t2 ORDER BY b;
}
} {11 55 66 77 88 99}
do_test rowid-7.6 {
execsql {
SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647);
}
} {11}
do_test rowid-7.7 {
execsql {
INSERT INTO t2(b) VALUES(22);
INSERT INTO t2(b) VALUES(33);
INSERT INTO t2(b) VALUES(44);
INSERT INTO t2(b) VALUES(55);
SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647) ORDER BY b;
}
} {11 22 33 44 55}
ifcapable subquery {
do_test rowid-7.6 {
execsql {
SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647);
}
} {11}
do_test rowid-7.7 {
execsql {
INSERT INTO t2(b) VALUES(22);
INSERT INTO t2(b) VALUES(33);
INSERT INTO t2(b) VALUES(44);
INSERT INTO t2(b) VALUES(55);
SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647)
ORDER BY b;
}
} {11 22 33 44 55}
}
do_test rowid-7.8 {
execsql {
DELETE FROM t2 WHERE a!=2;

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement.
#
# $Id: select1.test,v 1.40 2005/01/18 17:20:10 drh Exp $
# $Id: select1.test,v 1.41 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -585,11 +585,13 @@ do_test select1-9.2 {
db eval {SELECT * FROM test1 WHERE f1<0} r {}
set r(*)
} {f1 f2}
do_test select1-9.3 {
set r(*) {}
db eval {SELECT * FROM test1 WHERE f1<(select count(*) from test2)} r {}
set r(*)
} {f1 f2}
ifcapable subquery {
do_test select1-9.3 {
set r(*) {}
db eval {SELECT * FROM test1 WHERE f1<(select count(*) from test2)} r {}
set r(*)
} {f1 f2}
}
do_test select1-9.4 {
set r(*) {}
db eval {SELECT * FROM test1 ORDER BY f1} r {}
@ -701,26 +703,28 @@ do_test select1-11.11 {
SELECT t3.* FROM t3 AS x, t4;
}
} {1 {no such table: t3}}
do_test select1-11.12 {
execsql2 {
SELECT t3.* FROM t3, (SELECT max(a), max(b) FROM t4)
}
} {a 1 b 2}
do_test select1-11.13 {
execsql2 {
SELECT t3.* FROM (SELECT max(a), max(b) FROM t4), t3
}
} {a 1 b 2}
do_test select1-11.14 {
execsql2 {
SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) AS 'tx'
}
} {a 1 b 2 max(a) 3 max(b) 4}
do_test select1-11.15 {
execsql2 {
SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
}
} {max(a) 3 max(b) 4 a 1 b 2}
ifcapable subquery {
do_test select1-11.12 {
execsql2 {
SELECT t3.* FROM t3, (SELECT max(a), max(b) FROM t4)
}
} {a 1 b 2}
do_test select1-11.13 {
execsql2 {
SELECT t3.* FROM (SELECT max(a), max(b) FROM t4), t3
}
} {a 1 b 2}
do_test select1-11.14 {
execsql2 {
SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) AS 'tx'
}
} {a 1 b 2 max(a) 3 max(b) 4}
do_test select1-11.15 {
execsql2 {
SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
}
} {max(a) 3 max(b) 4 a 1 b 2}
}
do_test select1-11.16 {
execsql2 {
SELECT y.* FROM t3 as y, t4 as z
@ -765,16 +769,18 @@ do_test select1-12.6 {
} {1 2 3 4}
} ;# ifcapable compound
do_test select1-12.7 {
execsql {
SELECT * FROM t3 WHERE a=(SELECT 1);
}
} {1 2}
do_test select1-12.8 {
execsql {
SELECT * FROM t3 WHERE a=(SELECT 2);
}
} {}
ifcapable subquery {
do_test select1-12.7 {
execsql {
SELECT * FROM t3 WHERE a=(SELECT 1);
}
} {1 2}
do_test select1-12.8 {
execsql {
SELECT * FROM t3 WHERE a=(SELECT 2);
}
} {}
}
ifcapable compound {
do_test select1-12.9 {

View File

@ -12,11 +12,17 @@
# focus of this file is testing SELECT statements that contain
# subqueries in their FROM clause.
#
# $Id: select6.test,v 1.15 2004/11/22 15:05:59 danielk1977 Exp $
# $Id: select6.test,v 1.16 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Omit this whole file if the library is build without subquery support.
ifcapable !subquery {
finish_test
return
}
do_test select6-1.0 {
execsql {
BEGIN;

View File

@ -10,7 +10,7 @@
# focus of this file is testing compute SELECT statements and nested
# views.
#
# $Id: select7.test,v 1.4 2005/01/03 02:26:55 drh Exp $
# $Id: select7.test,v 1.5 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
@ -54,9 +54,11 @@ do_test select7-2.1 {
# Do not allow GROUP BY without an aggregate. Ticket #1039.
#
do_test select7-3.1 {
catchsql {
SELECT * FROM (SELECT * FROM sqlite_master) GROUP BY name
}
} {1 {GROUP BY may only be used on aggregate queries}}
ifcapable subquery {
do_test select7-3.1 {
catchsql {
SELECT * FROM (SELECT * FROM sqlite_master) GROUP BY name
}
} {1 {GROUP BY may only be used on aggregate queries}}
}
finish_test

View File

@ -12,11 +12,17 @@
# focus of this file is testing SELECT statements that are part of
# expressions.
#
# $Id: subselect.test,v 1.11 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: subselect.test,v 1.12 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Omit this whole file if the library is build without subquery support.
ifcapable !subquery {
finish_test
return
}
# Basic sanity checking. Try a simple subselect.
#
do_test subselect-1.1 {

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the CREATE TABLE statement.
#
# $Id: table.test,v 1.35 2004/11/23 22:16:40 drh Exp $
# $Id: table.test,v 1.36 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -514,8 +514,14 @@ do_test table-11.2 {
# Test that when creating a table using CREATE TABLE AS, column types are
# assigned correctly for (SELECT ...) and 'x AS y' expressions.
do_test table-12.1 {
execsql {
CREATE TABLE t8 AS SELECT b, h, a as i, (SELECT f FROM t7) as j FROM t7;
ifcapable subquery {
execsql {
CREATE TABLE t8 AS SELECT b, h, a as i, (SELECT f FROM t7) as j FROM t7;
}
} else {
execsql {
CREATE TABLE t8 AS SELECT b, h, a as i, f as j FROM t7;
}
}
} {}
do_test table-12.2 {

View File

@ -12,7 +12,7 @@
# focus of this file is testing the sqlite_exec_printf() and
# sqlite_get_table_printf() APIs.
#
# $Id: tableapi.test,v 1.9 2004/06/19 03:33:57 danielk1977 Exp $
# $Id: tableapi.test,v 1.10 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -83,9 +83,15 @@ do_test tableapi-2.6 {
sqlite3_get_table_printf $::dbx {
INSERT INTO xyz VALUES(52,NULL)
} {}
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
} {}
ifcapable subquery {
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
} {}
} else {
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a=42 OR a=50 OR a=52 ORDER BY a DESC
} {}
}
} {0 3 2 a b 52 NULL 50 (50) 42 (42)}
do_test tableapi-2.7 {
sqlite3_get_table_printf $::dbx {
@ -140,9 +146,15 @@ do_test tableapi-3.6 {
sqlite3_get_table_printf $::dbx {
INSERT INTO xyz VALUES(52,NULL)
} {}
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
} {}
ifcapable subquery {
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
} {}
} else {
sqlite3_get_table_printf $::dbx {
SELECT * FROM xyz WHERE a=42 OR a=50 OR a=52 ORDER BY a DESC
} {}
}
} {0 3 2 a b 52 NULL 50 (50) 42 (42)}
do_test tableapi-3.7 {
sqlite3_get_table_printf $::dbx {

View File

@ -11,7 +11,7 @@
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.44 2005/01/13 11:07:54 danielk1977 Exp $
# $Id: tester.tcl,v 1.45 2005/01/21 03:12:16 danielk1977 Exp $
# Make sure tclsqlite3 was compiled correctly. Abort now with an
# error message if not.
@ -240,10 +240,14 @@ proc integrity_check {name} {
# Evaluate a boolean expression of capabilities. If true, execute the
# code. Omit the code if false.
#
proc ifcapable {expr code} {
proc ifcapable {expr code {else ""} {elsecode ""}} {
regsub -all {[a-z_0-9]+} $expr {$::sqlite_options(&)} e2
if !($e2) return
return -code [catch {uplevel 1 $code}]
if ($e2) {
set c [catch {uplevel 1 $code} r]
} else {
set c [catch {uplevel 1 $elsecode} r]
}
return -code $c $r
}
# This proc execs a seperate process that crashes midway through executing

View File

@ -12,7 +12,7 @@
# of this file is testing the interaction of manifest types, type affinity
# and comparison expressions.
#
# $Id: types2.test,v 1.4 2004/07/19 00:39:46 drh Exp $
# $Id: types2.test,v 1.5 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -196,38 +196,40 @@ test_bool types2-4.26 {o1='500'} {'500' > o1} 0
test_bool types2-4.27 {o1='500'} {500.0 > o1} 0
test_bool types2-4.28 {o1='500'} {'500.0' > o1} 1
# types2-5.* - The 'IN (x, y....)' operator with no index.
#
# Compare literals against literals (always a numeric comparison).
test_bool types2-5.1 {} {(NULL IN ('10.0', 20)) ISNULL} 1
test_bool types2-5.2 {} {10 IN ('10.0', 20)} 1
test_bool types2-5.3 {} {'10' IN ('10.0', 20)} 1
test_bool types2-5.4 {} {10 IN (10.0, 20)} 1
test_bool types2-5.5 {} {'10.0' IN (10, 20)} 1
# Compare literals against a column with TEXT affinity
test_bool types2-5.6 {t1='10.0'} {t1 IN (10.0, 20)} 1
test_bool types2-5.7 {t1='10.0'} {t1 IN (10, 20)} 0
test_bool types2-5.8 {t1='10'} {t1 IN (10.0, 20)} 0
test_bool types2-5.9 {t1='10'} {t1 IN (20, '10.0')} 0
test_bool types2-5.10 {t1=10} {t1 IN (20, '10')} 1
# Compare literals against a column with NUMERIC affinity
test_bool types2-5.11 {n1='10.0'} {n1 IN (10.0, 20)} 1
test_bool types2-5.12 {n1='10.0'} {n1 IN (10, 20)} 1
test_bool types2-5.13 {n1='10'} {n1 IN (10.0, 20)} 1
test_bool types2-5.14 {n1='10'} {n1 IN (20, '10.0')} 1
test_bool types2-5.15 {n1=10} {n1 IN (20, '10')} 1
# Compare literals against a column with affinity NONE
test_bool types2-5.16 {o1='10.0'} {o1 IN (10.0, 20)} 0
test_bool types2-5.17 {o1='10.0'} {o1 IN (10, 20)} 0
test_bool types2-5.18 {o1='10'} {o1 IN (10.0, 20)} 0
test_bool types2-5.19 {o1='10'} {o1 IN (20, '10.0')} 0
test_bool types2-5.20 {o1=10} {o1 IN (20, '10')} 0
test_bool types2-5.21 {o1='10.0'} {o1 IN (10, 20, '10.0')} 1
test_bool types2-5.22 {o1='10'} {o1 IN (10.0, 20, '10')} 1
test_bool types2-5.23 {o1=10} {n1 IN (20, '10', 10)} 1
ifcapable subquery {
# types2-5.* - The 'IN (x, y....)' operator with no index.
#
# Compare literals against literals (always a numeric comparison).
test_bool types2-5.1 {} {(NULL IN ('10.0', 20)) ISNULL} 1
test_bool types2-5.2 {} {10 IN ('10.0', 20)} 1
test_bool types2-5.3 {} {'10' IN ('10.0', 20)} 1
test_bool types2-5.4 {} {10 IN (10.0, 20)} 1
test_bool types2-5.5 {} {'10.0' IN (10, 20)} 1
# Compare literals against a column with TEXT affinity
test_bool types2-5.6 {t1='10.0'} {t1 IN (10.0, 20)} 1
test_bool types2-5.7 {t1='10.0'} {t1 IN (10, 20)} 0
test_bool types2-5.8 {t1='10'} {t1 IN (10.0, 20)} 0
test_bool types2-5.9 {t1='10'} {t1 IN (20, '10.0')} 0
test_bool types2-5.10 {t1=10} {t1 IN (20, '10')} 1
# Compare literals against a column with NUMERIC affinity
test_bool types2-5.11 {n1='10.0'} {n1 IN (10.0, 20)} 1
test_bool types2-5.12 {n1='10.0'} {n1 IN (10, 20)} 1
test_bool types2-5.13 {n1='10'} {n1 IN (10.0, 20)} 1
test_bool types2-5.14 {n1='10'} {n1 IN (20, '10.0')} 1
test_bool types2-5.15 {n1=10} {n1 IN (20, '10')} 1
# Compare literals against a column with affinity NONE
test_bool types2-5.16 {o1='10.0'} {o1 IN (10.0, 20)} 0
test_bool types2-5.17 {o1='10.0'} {o1 IN (10, 20)} 0
test_bool types2-5.18 {o1='10'} {o1 IN (10.0, 20)} 0
test_bool types2-5.19 {o1='10'} {o1 IN (20, '10.0')} 0
test_bool types2-5.20 {o1=10} {o1 IN (20, '10')} 0
test_bool types2-5.21 {o1='10.0'} {o1 IN (10, 20, '10.0')} 1
test_bool types2-5.22 {o1='10'} {o1 IN (10.0, 20, '10')} 1
test_bool types2-5.23 {o1=10} {n1 IN (20, '10', 10)} 1
}
# Tests named types2-6.* use the same infrastructure as the types2-2.*
# tests. The contents of the vals array is repeated here for easy
@ -236,17 +238,19 @@ test_bool types2-5.23 {o1=10} {n1 IN (20, '10', 10)} 1
# set vals [list 10 10.0 '10' '10.0' 20 20.0 '20' '20.0' 30 30.0 '30' '30.0']
# 1 2 3 4 5 6 7 8 9 10 11 12
test_boolset types2-6.1 {o IN ('10', 30)} {3 9 10}
test_boolset types2-6.2 {o IN (20.0, 30.0)} {5 6 9 10}
test_boolset types2-6.3 {t IN ('10', 30)} {1 3 9 11}
test_boolset types2-6.4 {t IN (20.0, 30.0)} {6 8 10 12}
test_boolset types2-6.5 {n IN ('10', 30)} {1 2 3 4 9 10 11 12}
test_boolset types2-6.6 {n IN (20.0, 30.0)} {5 6 7 8 9 10 11 12}
test_boolset types2-6.7 {i IN ('10', 30)} {1 2 3 4 9 10 11 12}
test_boolset types2-6.8 {i IN (20.0, 30.0)} {5 6 7 8 9 10 11 12}
ifcapable subquery {
test_boolset types2-6.1 {o IN ('10', 30)} {3 9 10}
test_boolset types2-6.2 {o IN (20.0, 30.0)} {5 6 9 10}
test_boolset types2-6.3 {t IN ('10', 30)} {1 3 9 11}
test_boolset types2-6.4 {t IN (20.0, 30.0)} {6 8 10 12}
test_boolset types2-6.5 {n IN ('10', 30)} {1 2 3 4 9 10 11 12}
test_boolset types2-6.6 {n IN (20.0, 30.0)} {5 6 7 8 9 10 11 12}
test_boolset types2-6.7 {i IN ('10', 30)} {1 2 3 4 9 10 11 12}
test_boolset types2-6.8 {i IN (20.0, 30.0)} {5 6 7 8 9 10 11 12}
# Also test than IN(x, y, z) works on a rowid:
test_boolset types2-6.9 {rowid IN (1, 6, 10)} {1 6 10}
# Also test than IN(x, y, z) works on a rowid:
test_boolset types2-6.9 {rowid IN (1, 6, 10)} {1 6 10}
}
# Tests types2-7.* concentrate on expressions of the form
# "x IN (SELECT...)" with no index.
@ -259,29 +263,31 @@ execsql {
INSERT INTO t3 VALUES('1.0', '1.0', '1.0', '1.0');
}
test_bool types2-7.1 {i1=1} {i1 IN (SELECT i FROM t3)} 1
test_bool types2-7.2 {i1='2.0'} {i1 IN (SELECT i FROM t3)} 1
test_bool types2-7.3 {i1='2.0'} {i1 IN (SELECT n FROM t3)} 1
test_bool types2-7.4 {i1='2.0'} {i1 IN (SELECT t FROM t3)} 1
test_bool types2-7.5 {i1='2.0'} {i1 IN (SELECT o FROM t3)} 1
test_bool types2-7.6 {n1=1} {n1 IN (SELECT n FROM t3)} 1
test_bool types2-7.7 {n1='2.0'} {n1 IN (SELECT i FROM t3)} 1
test_bool types2-7.8 {n1='2.0'} {n1 IN (SELECT n FROM t3)} 1
test_bool types2-7.9 {n1='2.0'} {n1 IN (SELECT t FROM t3)} 1
test_bool types2-7.10 {n1='2.0'} {n1 IN (SELECT o FROM t3)} 1
test_bool types2-7.6 {t1=1} {t1 IN (SELECT t FROM t3)} 1
test_bool types2-7.7 {t1='2.0'} {t1 IN (SELECT t FROM t3)} 0
test_bool types2-7.8 {t1='2.0'} {t1 IN (SELECT n FROM t3)} 1
test_bool types2-7.9 {t1='2.0'} {t1 IN (SELECT i FROM t3)} 1
test_bool types2-7.10 {t1='2.0'} {t1 IN (SELECT o FROM t3)} 0
test_bool types2-7.11 {t1='1.0'} {t1 IN (SELECT t FROM t3)} 1
test_bool types2-7.12 {t1='1.0'} {t1 IN (SELECT o FROM t3)} 1
test_bool types2-7.13 {o1=2} {o1 IN (SELECT o FROM t3)} 1
test_bool types2-7.14 {o1='2'} {o1 IN (SELECT o FROM t3)} 0
test_bool types2-7.15 {o1='2'} {o1 IN (SELECT o||'' FROM t3)} 1
ifcapable subquery {
test_bool types2-7.1 {i1=1} {i1 IN (SELECT i FROM t3)} 1
test_bool types2-7.2 {i1='2.0'} {i1 IN (SELECT i FROM t3)} 1
test_bool types2-7.3 {i1='2.0'} {i1 IN (SELECT n FROM t3)} 1
test_bool types2-7.4 {i1='2.0'} {i1 IN (SELECT t FROM t3)} 1
test_bool types2-7.5 {i1='2.0'} {i1 IN (SELECT o FROM t3)} 1
test_bool types2-7.6 {n1=1} {n1 IN (SELECT n FROM t3)} 1
test_bool types2-7.7 {n1='2.0'} {n1 IN (SELECT i FROM t3)} 1
test_bool types2-7.8 {n1='2.0'} {n1 IN (SELECT n FROM t3)} 1
test_bool types2-7.9 {n1='2.0'} {n1 IN (SELECT t FROM t3)} 1
test_bool types2-7.10 {n1='2.0'} {n1 IN (SELECT o FROM t3)} 1
test_bool types2-7.6 {t1=1} {t1 IN (SELECT t FROM t3)} 1
test_bool types2-7.7 {t1='2.0'} {t1 IN (SELECT t FROM t3)} 0
test_bool types2-7.8 {t1='2.0'} {t1 IN (SELECT n FROM t3)} 1
test_bool types2-7.9 {t1='2.0'} {t1 IN (SELECT i FROM t3)} 1
test_bool types2-7.10 {t1='2.0'} {t1 IN (SELECT o FROM t3)} 0
test_bool types2-7.11 {t1='1.0'} {t1 IN (SELECT t FROM t3)} 1
test_bool types2-7.12 {t1='1.0'} {t1 IN (SELECT o FROM t3)} 1
test_bool types2-7.13 {o1=2} {o1 IN (SELECT o FROM t3)} 1
test_bool types2-7.14 {o1='2'} {o1 IN (SELECT o FROM t3)} 0
test_bool types2-7.15 {o1='2'} {o1 IN (SELECT o||'' FROM t3)} 1
}
# set vals [list 10 10.0 '10' '10.0' 20 20.0 '20' '20.0' 30 30.0 '30' '30.0']
# 1 2 3 4 5 6 7 8 9 10 11 12
@ -289,17 +295,19 @@ execsql {
CREATE TABLE t4(i INTEGER, n NUMERIC, t VARCHAR(20), o LARGE BLOB);
INSERT INTO t4 VALUES(10, 20, 20, 30);
}
test_boolset types2-8.1 {i IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.2 {n IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.3 {t IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.4 {o IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.5 {i IN (SELECT t FROM t4)} {5 6 7 8}
test_boolset types2-8.6 {n IN (SELECT t FROM t4)} {5 6 7 8}
test_boolset types2-8.7 {t IN (SELECT t FROM t4)} {5 7}
test_boolset types2-8.8 {o IN (SELECT t FROM t4)} {7}
test_boolset types2-8.9 {i IN (SELECT o FROM t4)} {9 10 11 12}
test_boolset types2-8.6 {n IN (SELECT o FROM t4)} {9 10 11 12}
test_boolset types2-8.7 {t IN (SELECT o FROM t4)} {9 11}
test_boolset types2-8.8 {o IN (SELECT o FROM t4)} {9 10}
ifcapable subquery {
test_boolset types2-8.1 {i IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.2 {n IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.3 {t IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.4 {o IN (SELECT i FROM t4)} {1 2 3 4}
test_boolset types2-8.5 {i IN (SELECT t FROM t4)} {5 6 7 8}
test_boolset types2-8.6 {n IN (SELECT t FROM t4)} {5 6 7 8}
test_boolset types2-8.7 {t IN (SELECT t FROM t4)} {5 7}
test_boolset types2-8.8 {o IN (SELECT t FROM t4)} {7}
test_boolset types2-8.9 {i IN (SELECT o FROM t4)} {9 10 11 12}
test_boolset types2-8.6 {n IN (SELECT o FROM t4)} {9 10 11 12}
test_boolset types2-8.7 {t IN (SELECT o FROM t4)} {9 11}
test_boolset types2-8.8 {o IN (SELECT o FROM t4)} {9 10}
}
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the UPDATE statement.
#
# $Id: update.test,v 1.16 2005/01/15 00:40:43 drh Exp $
# $Id: update.test,v 1.17 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -483,18 +483,20 @@ do_test update-10.10 {
# Make sure we can handle a subquery in the where clause.
#
do_test update-11.1 {
execsql {
UPDATE t1 SET e=e+1 WHERE b IN (SELECT b FROM t1);
SELECT b,e FROM t1;
}
} {2 14 3 7}
do_test update-11.2 {
execsql {
UPDATE t1 SET e=e+1 WHERE a IN (SELECT a FROM t1);
SELECT a,e FROM t1;
}
} {1 15 2 8}
ifcapable subquery {
do_test update-11.1 {
execsql {
UPDATE t1 SET e=e+1 WHERE b IN (SELECT b FROM t1);
SELECT b,e FROM t1;
}
} {2 14 3 7}
do_test update-11.2 {
execsql {
UPDATE t1 SET e=e+1 WHERE a IN (SELECT a FROM t1);
SELECT a,e FROM t1;
}
} {1 15 2 8}
}
integrity_check update-12.1

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the use of indices in WHERE clases.
#
# $Id: where.test,v 1.27 2005/01/11 18:13:57 drh Exp $
# $Id: where.test,v 1.28 2005/01/21 03:12:16 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -29,8 +29,19 @@ do_test where-1.0 {
set y [expr {$i*$i + 2*$i + 1}]
execsql "INSERT INTO t1 VALUES($w,$x,$y)"
}
ifcapable subquery {
execsql {
INSERT INTO t2 SELECT 101-w, x, (SELECT max(y) FROM t1)+1-y, y FROM t1;
}
} else {
set maxy [execsql {select max(y) from t1}]
execsql "
INSERT INTO t2 SELECT 101-w, x, $maxy+1-y, y FROM t1;
"
}
execsql {
INSERT INTO t2 SELECT 101-w, x, (SELECT max(y) FROM t1)+1-y, y FROM t1;
CREATE INDEX i1w ON t1(w);
CREATE INDEX i1xy ON t1(x,y);
CREATE INDEX i2p ON t2(p);
@ -291,85 +302,88 @@ do_test where-4.4 {
} {99}
# Verify that IN operators in a WHERE clause are handled correctly.
# Omit these tests if the build is not capable of sub-queries.
#
do_test where-5.1 {
count {
SELECT * FROM t1 WHERE rowid IN (1,2,3,1234) order by 1;
}
} {1 0 4 2 1 9 3 1 16 3}
do_test where-5.2 {
count {
SELECT * FROM t1 WHERE rowid+0 IN (1,2,3,1234) order by 1;
}
} {1 0 4 2 1 9 3 1 16 199}
do_test where-5.3 {
count {
SELECT * FROM t1 WHERE w IN (-1,1,2,3) order by 1;
}
} {1 0 4 2 1 9 3 1 16 13}
do_test where-5.4 {
count {
SELECT * FROM t1 WHERE w+0 IN (-1,1,2,3) order by 1;
}
} {1 0 4 2 1 9 3 1 16 199}
do_test where-5.5 {
count {
SELECT * FROM t1 WHERE rowid IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 3}
do_test where-5.6 {
count {
SELECT * FROM t1 WHERE rowid+0 IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 201}
do_test where-5.7 {
count {
SELECT * FROM t1 WHERE w IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 9}
do_test where-5.8 {
count {
SELECT * FROM t1 WHERE w+0 IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 201}
do_test where-5.9 {
count {
SELECT * FROM t1 WHERE x IN (1,7) ORDER BY 1;
}
} {2 1 9 3 1 16 7}
do_test where-5.10 {
count {
SELECT * FROM t1 WHERE x+0 IN (1,7) ORDER BY 1;
}
} {2 1 9 3 1 16 199}
do_test where-5.11 {
count {
SELECT * FROM t1 WHERE y IN (6400,8100) ORDER BY 1;
}
} {79 6 6400 89 6 8100 199}
do_test where-5.12 {
count {
SELECT * FROM t1 WHERE x=6 AND y IN (6400,8100) ORDER BY 1;
}
} {79 6 6400 89 6 8100 74}
do_test where-5.13 {
count {
SELECT * FROM t1 WHERE x IN (1,7) AND y NOT IN (6400,8100) ORDER BY 1;
}
} {2 1 9 3 1 16 7}
do_test where-5.14 {
count {
SELECT * FROM t1 WHERE x IN (1,7) AND y IN (9,10) ORDER BY 1;
}
} {2 1 9 7}
ifcapable subquery {
do_test where-5.1 {
count {
SELECT * FROM t1 WHERE rowid IN (1,2,3,1234) order by 1;
}
} {1 0 4 2 1 9 3 1 16 3}
do_test where-5.2 {
count {
SELECT * FROM t1 WHERE rowid+0 IN (1,2,3,1234) order by 1;
}
} {1 0 4 2 1 9 3 1 16 199}
do_test where-5.3 {
count {
SELECT * FROM t1 WHERE w IN (-1,1,2,3) order by 1;
}
} {1 0 4 2 1 9 3 1 16 13}
do_test where-5.4 {
count {
SELECT * FROM t1 WHERE w+0 IN (-1,1,2,3) order by 1;
}
} {1 0 4 2 1 9 3 1 16 199}
do_test where-5.5 {
count {
SELECT * FROM t1 WHERE rowid IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 3}
do_test where-5.6 {
count {
SELECT * FROM t1 WHERE rowid+0 IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 201}
do_test where-5.7 {
count {
SELECT * FROM t1 WHERE w IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 9}
do_test where-5.8 {
count {
SELECT * FROM t1 WHERE w+0 IN
(select rowid from t1 where rowid IN (-1,2,4))
ORDER BY 1;
}
} {2 1 9 4 2 25 201}
do_test where-5.9 {
count {
SELECT * FROM t1 WHERE x IN (1,7) ORDER BY 1;
}
} {2 1 9 3 1 16 7}
do_test where-5.10 {
count {
SELECT * FROM t1 WHERE x+0 IN (1,7) ORDER BY 1;
}
} {2 1 9 3 1 16 199}
do_test where-5.11 {
count {
SELECT * FROM t1 WHERE y IN (6400,8100) ORDER BY 1;
}
} {79 6 6400 89 6 8100 199}
do_test where-5.12 {
count {
SELECT * FROM t1 WHERE x=6 AND y IN (6400,8100) ORDER BY 1;
}
} {79 6 6400 89 6 8100 74}
do_test where-5.13 {
count {
SELECT * FROM t1 WHERE x IN (1,7) AND y NOT IN (6400,8100) ORDER BY 1;
}
} {2 1 9 3 1 16 7}
do_test where-5.14 {
count {
SELECT * FROM t1 WHERE x IN (1,7) AND y IN (9,10) ORDER BY 1;
}
} {2 1 9 7}
}
# This procedure executes the SQL. Then it checks to see if the OP_Sort
# opcode was executed. If an OP_Sort did occur, then "sort" is appended
@ -428,11 +442,13 @@ do_test where-6.7 {
SELECT * FROM t3 WHERE b>0 ORDER BY a LIMIT 3
}
} {1 100 4 2 99 9 3 98 16 sort}
do_test where-6.8 {
cksort {
SELECT * FROM t3 WHERE a IN (3,5,7,1,9,4,2) ORDER BY a LIMIT 3
}
} {1 100 4 2 99 9 3 98 16 sort}
ifcapable subquery {
do_test where-6.8 {
cksort {
SELECT * FROM t3 WHERE a IN (3,5,7,1,9,4,2) ORDER BY a LIMIT 3
}
} {1 100 4 2 99 9 3 98 16 sort}
}
do_test where-6.9.1 {
cksort {
SELECT * FROM t3 WHERE a=1 AND c>0 ORDER BY a LIMIT 3