Change exists.test to run all tests with and without "PRAGMA journal_mode=WAL".

FossilOrigin-Name: c4e624db1a981fe6e520af51efc6ce33bca2c714
This commit is contained in:
dan 2011-04-11 05:38:31 +00:00
parent bce7365cb4
commit 9020de6a81
3 changed files with 169 additions and 163 deletions

View File

@ -1,5 +1,5 @@
C Add\sa\ssimple\stest\sprogram\sto\said\sin\sverifying\sthat\sjournals\sare\scross-platform.
D 2011-04-10T16:39:23.788
C Change\sexists.test\sto\srun\sall\stests\swith\sand\swithout\s"PRAGMA\sjournal_mode=WAL".
D 2011-04-11T05:38:31.768
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -388,7 +388,7 @@ F test/eval.test bc269c365ba877554948441e91ad5373f9f91be3
F test/exclusive.test 53e1841b422e554cecf0160f937c473d6d0e3062
F test/exclusive2.test 343d55130c12c67b8bf10407acec043a6c26c86b
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
F test/exists.test 81363f6982ea49dfd820a50845466390e60a4a0c
F test/exists.test 5e2d64b4eb5a9d08876599bdae2e1213d2d12e2a
F test/expr.test 19e8ac40313e2282a47b586d11c4892040990d3a
F test/fallocate.test 43dc34b8c24be6baffadc3b4401ee15710ce83c6
F test/filectrl.test 97003734290887566e01dded09dc9e99cb937e9e
@ -929,7 +929,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P f346dae1278b5b0cc0cd8e05aa3b4d8f70d2dc1d
R 787af88c88556ef35e242179ba67cd89
U drh
Z 78bbdd619a80aac136302ef91f42dd4a
P a65a7a59d19a64ba1aec388d23ada79aaaaa6f26
R 4ba23071ac32ebdf25f66de1fbb24e0a
U dan
Z a38692cc4f2fcc5ccb895a8b6cae861a

View File

@ -1 +1 @@
a65a7a59d19a64ba1aec388d23ada79aaaaa6f26
c4e624db1a981fe6e520af51efc6ce33bca2c714

View File

@ -17,175 +17,181 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
set testprefix exists
# This block of tests is targeted at CREATE XXX IF NOT EXISTS statements.
#
do_multiclient_test tn {
foreach jm {rollback wal} {
# TABLE objects.
set testprefix exists-$jm
# This block of tests is targeted at CREATE XXX IF NOT EXISTS statements.
#
do_test 1.$tn.1.1 {
sql2 { CREATE TABLE t1(x) }
sql1 { CREATE TABLE IF NOT EXISTS t1(a, b) }
sql2 { DROP TABLE t1 }
sql1 { CREATE TABLE IF NOT EXISTS t1(a, b) }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {t1}
do_multiclient_test tn {
do_test 1.$tn.1.2 {
sql2 { CREATE TABLE t2(x) }
sql1 { CREATE TABLE IF NOT EXISTS t2 AS SELECT * FROM t1 }
sql2 { DROP TABLE t2 }
sql1 { CREATE TABLE IF NOT EXISTS t2 AS SELECT * FROM t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {t1 t2}
# TABLE objects.
#
do_test 1.$tn.1.1 {
if {$jm == "wal"} { sql2 { PRAGMA journal_mode = WAL } }
sql2 { CREATE TABLE t1(x) }
sql1 { CREATE TABLE IF NOT EXISTS t1(a, b) }
sql2 { DROP TABLE t1 }
sql1 { CREATE TABLE IF NOT EXISTS t1(a, b) }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {t1}
do_test 1.$tn.1.2 {
sql2 { CREATE TABLE t2(x) }
sql1 { CREATE TABLE IF NOT EXISTS t2 AS SELECT * FROM t1 }
sql2 { DROP TABLE t2 }
sql1 { CREATE TABLE IF NOT EXISTS t2 AS SELECT * FROM t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {t1 t2}
# INDEX objects.
# INDEX objects.
#
do_test 1.$tn.2 {
sql2 { CREATE INDEX i1 ON t1(a) }
sql1 { CREATE INDEX IF NOT EXISTS i1 ON t1(a, b) }
sql2 { DROP INDEX i1 }
sql1 { CREATE INDEX IF NOT EXISTS i1 ON t1(a, b) }
sql2 { SELECT name FROM sqlite_master WHERE type = 'index' }
} {i1}
# VIEW objects.
#
do_test 1.$tn.3 {
sql2 { CREATE VIEW v1 AS SELECT * FROM t1 }
sql1 { CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 }
sql2 { DROP VIEW v1 }
sql1 { CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'view' }
} {v1}
# TRIGGER objects.
#
do_test $tn.4 {
sql2 { CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql1 { CREATE TRIGGER IF NOT EXISTS tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql2 { DROP TRIGGER tr1 }
sql1 { CREATE TRIGGER IF NOT EXISTS tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql2 { SELECT name FROM sqlite_master WHERE type = 'trigger' }
} {tr1}
}
# This block of tests is targeted at DROP XXX IF EXISTS statements.
#
do_test 1.$tn.2 {
sql2 { CREATE INDEX i1 ON t1(a) }
sql1 { CREATE INDEX IF NOT EXISTS i1 ON t1(a, b) }
sql2 { DROP INDEX i1 }
sql1 { CREATE INDEX IF NOT EXISTS i1 ON t1(a, b) }
sql2 { SELECT name FROM sqlite_master WHERE type = 'index' }
} {i1}
do_multiclient_test tn {
# VIEW objects.
# TABLE objects.
#
do_test 2.$tn.1 {
if {$jm == "wal"} { sql1 { PRAGMA journal_mode = WAL } }
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { CREATE TABLE t1(x) }
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {}
# INDEX objects.
#
do_test 2.$tn.2 {
sql1 { CREATE TABLE t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { CREATE INDEX i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'index' }
} {}
# VIEW objects.
#
do_test 2.$tn.3 {
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { CREATE VIEW v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'view' }
} {}
# TRIGGER objects.
#
do_test 2.$tn.4 {
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { CREATE TRIGGER tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'trigger' }
} {}
}
# This block of tests is targeted at DROP XXX IF EXISTS statements with
# attached databases.
#
do_test 1.$tn.3 {
sql2 { CREATE VIEW v1 AS SELECT * FROM t1 }
sql1 { CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 }
sql2 { DROP VIEW v1 }
sql1 { CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'view' }
} {v1}
do_multiclient_test tn {
# TRIGGER objects.
#
do_test $tn.4 {
sql2 { CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql1 { CREATE TRIGGER IF NOT EXISTS tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql2 { DROP TRIGGER tr1 }
sql1 { CREATE TRIGGER IF NOT EXISTS tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END }
sql2 { SELECT name FROM sqlite_master WHERE type = 'trigger' }
} {tr1}
}
forcedelete test.db2
do_test 3.$tn.0 {
sql1 { ATTACH 'test.db2' AS aux }
sql2 { ATTACH 'test.db2' AS aux }
} {}
# This block of tests is targeted at DROP XXX IF EXISTS statements.
#
do_multiclient_test tn {
# TABLE objects.
#
do_test 3.$tn.1.1 {
sql1 { DROP TABLE IF EXISTS aux.t1 }
sql2 { CREATE TABLE aux.t1(x) }
sql1 { DROP TABLE IF EXISTS aux.t1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'table' }
} {}
do_test 3.$tn.1.2 {
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { CREATE TABLE aux.t1(x) }
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'table' }
} {}
# TABLE objects.
#
do_test 2.$tn.1 {
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { CREATE TABLE t1(x) }
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'table' }
} {}
# INDEX objects.
#
do_test 3.$tn.2.1 {
sql1 { CREATE TABLE aux.t2(x) }
sql1 { DROP INDEX IF EXISTS aux.i2 }
sql2 { CREATE INDEX aux.i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS aux.i2 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'index' }
} {}
do_test 3.$tn.2.2 {
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { CREATE INDEX aux.i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'index' }
} {}
# INDEX objects.
#
do_test 2.$tn.2 {
sql1 { CREATE TABLE t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { CREATE INDEX i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'index' }
} {}
# VIEW objects.
#
do_test 3.$tn.3.1 {
sql1 { DROP VIEW IF EXISTS aux.v1 }
sql2 { CREATE VIEW aux.v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS aux.v1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'view' }
} {}
do_test 3.$tn.3.2 {
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { CREATE VIEW aux.v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'view' }
} {}
# VIEW objects.
#
do_test 2.$tn.3 {
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { CREATE VIEW v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'view' }
} {}
# TRIGGER objects.
#
do_test 2.$tn.4 {
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { CREATE TRIGGER tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { SELECT name FROM sqlite_master WHERE type = 'trigger' }
} {}
}
# This block of tests is targeted at DROP XXX IF EXISTS statements with
# attached databases.
#
do_multiclient_test tn {
forcedelete test.db2
do_test 3.$tn.0 {
sql1 { ATTACH 'test.db2' AS aux }
sql2 { ATTACH 'test.db2' AS aux }
} {}
# TABLE objects.
#
do_test 3.$tn.1.1 {
sql1 { DROP TABLE IF EXISTS aux.t1 }
sql2 { CREATE TABLE aux.t1(x) }
sql1 { DROP TABLE IF EXISTS aux.t1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'table' }
} {}
do_test 3.$tn.1.2 {
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { CREATE TABLE aux.t1(x) }
sql1 { DROP TABLE IF EXISTS t1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'table' }
} {}
# INDEX objects.
#
do_test 3.$tn.2.1 {
sql1 { CREATE TABLE aux.t2(x) }
sql1 { DROP INDEX IF EXISTS aux.i2 }
sql2 { CREATE INDEX aux.i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS aux.i2 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'index' }
} {}
do_test 3.$tn.2.2 {
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { CREATE INDEX aux.i2 ON t2(x) }
sql1 { DROP INDEX IF EXISTS i2 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'index' }
} {}
# VIEW objects.
#
do_test 3.$tn.3.1 {
sql1 { DROP VIEW IF EXISTS aux.v1 }
sql2 { CREATE VIEW aux.v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS aux.v1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'view' }
} {}
do_test 3.$tn.3.2 {
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { CREATE VIEW aux.v1 AS SELECT * FROM t2 }
sql1 { DROP VIEW IF EXISTS v1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'view' }
} {}
# TRIGGER objects.
#
do_test 3.$tn.4.1 {
sql1 { DROP TRIGGER IF EXISTS aux.tr1 }
sql2 { CREATE TRIGGER aux.tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS aux.tr1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'trigger' }
} {}
do_test 3.$tn.4.2 {
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { CREATE TRIGGER aux.tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'trigger' }
} {}
# TRIGGER objects.
#
do_test 3.$tn.4.1 {
sql1 { DROP TRIGGER IF EXISTS aux.tr1 }
sql2 { CREATE TRIGGER aux.tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS aux.tr1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'trigger' }
} {}
do_test 3.$tn.4.2 {
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { CREATE TRIGGER aux.tr1 AFTER INSERT ON t2 BEGIN SELECT 1; END }
sql1 { DROP TRIGGER IF EXISTS tr1 }
sql2 { SELECT name FROM aux.sqlite_master WHERE type = 'trigger' }
} {}
}
}