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

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