1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fixes to the test suite (no code changes) so that quick.test runs with OMIT_ATTACH builds. #2706. (CVS 4480)

FossilOrigin-Name: 07c00fffe50e8380748f7ae02328531a75d64610
This commit is contained in:
danielk1977
2007-10-09 08:29:32 +00:00
parent 0cd1ea5e44
commit 5a8f9374ab
39 changed files with 1253 additions and 1158 deletions

View File

@ -13,7 +13,7 @@
# IO traffic generated by SQLite (making sure SQLite is not writing out
# more database pages than it has to, stuff like that).
#
# $Id: io.test,v 1.11 2007/10/03 21:18:20 drh Exp $
# $Id: io.test,v 1.12 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -229,36 +229,38 @@ do_test io-2.6.4 {
# use the same technique to check that it is created as in the above
# block.
file delete -force test2.db test2.db-journal
do_test io-2.7.1 {
execsql {
ATTACH 'test2.db' AS aux;
PRAGMA aux.page_size = 1024;
CREATE TABLE aux.abc2(a, b);
BEGIN;
INSERT INTO abc VALUES(9, 10);
}
file exists test.db-journal
} {0}
do_test io-2.7.2 {
execsql { INSERT INTO abc2 SELECT * FROM abc }
file exists test2.db-journal
} {0}
do_test io-2.7.3 {
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
} {1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10}
do_test io-2.7.4 {
set fd [open test2.db-journal w]
puts $fd "This is not a journal file"
close $fd
catchsql { COMMIT }
} {1 {unable to open database file}}
do_test io-2.7.5 {
file delete -force test2.db-journal
catchsql { COMMIT }
} {1 {cannot commit - no transaction is active}}
do_test io-2.7.6 {
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
} {1 2 3 4 5 6 7 8}
ifcapable attach {
do_test io-2.7.1 {
execsql {
ATTACH 'test2.db' AS aux;
PRAGMA aux.page_size = 1024;
CREATE TABLE aux.abc2(a, b);
BEGIN;
INSERT INTO abc VALUES(9, 10);
}
file exists test.db-journal
} {0}
do_test io-2.7.2 {
execsql { INSERT INTO abc2 SELECT * FROM abc }
file exists test2.db-journal
} {0}
do_test io-2.7.3 {
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
} {1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10}
do_test io-2.7.4 {
set fd [open test2.db-journal w]
puts $fd "This is not a journal file"
close $fd
catchsql { COMMIT }
} {1 {unable to open database file}}
do_test io-2.7.5 {
file delete -force test2.db-journal
catchsql { COMMIT }
} {1 {cannot commit - no transaction is active}}
do_test io-2.7.6 {
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
} {1 2 3 4 5 6 7 8}
}
# Try an explicit ROLLBACK before the journal file is created.
#