1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

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

@ -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 {