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

Adjust savepoint.test so that it can deal with SQLITE_TEMP_STORE=3. (CVS 6163)

FossilOrigin-Name: 3cb910f0ce116af3f291cb913b32abc89493bcc5
This commit is contained in:
drh
2009-01-11 00:18:38 +00:00
parent 9393497826
commit f57cf606bc
3 changed files with 23 additions and 17 deletions

View File

@ -9,7 +9,7 @@
#
#***********************************************************************
#
# $Id: savepoint.test,v 1.10 2009/01/07 10:35:19 danielk1977 Exp $
# $Id: savepoint.test,v 1.11 2009/01/11 00:18:38 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -589,6 +589,13 @@ do_test savepoint-10.1.3 {
}
} {}
# The lock state of the TEMP database can vary if SQLITE_TEMP_STORE=3
# And the following set of tests is only really interested in the status
# of the aux1 and aux2 locks. So record the current lock status of
# TEMP for use in the answers.
set templockstate [lindex [db eval {PRAGMA lock_status}] 3]
do_test savepoint-10.2.1 {
file delete -force test3.db
file delete -force test2.db
@ -608,7 +615,7 @@ do_test savepoint-10.2.1 {
} {t1 t2 t3}
do_test savepoint-10.2.2 {
execsql { PRAGMA lock_status }
} {main unlocked temp unlocked aux1 unlocked aux2 unlocked}
} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked]
do_test savepoint-10.2.3 {
execsql {
@ -616,20 +623,20 @@ do_test savepoint-10.2.3 {
INSERT INTO t1 VALUES(1, 2);
PRAGMA lock_status;
}
} {main reserved temp unlocked aux1 unlocked aux2 unlocked}
} [list main reserved temp $templockstate aux1 unlocked aux2 unlocked]
do_test savepoint-10.2.4 {
execsql {
INSERT INTO t3 VALUES(3, 4);
PRAGMA lock_status;
}
} {main reserved temp unlocked aux1 unlocked aux2 reserved}
} [list main reserved temp $templockstate aux1 unlocked aux2 reserved]
do_test savepoint-10.2.5 {
execsql {
SAVEPOINT two;
INSERT INTO t2 VALUES(5, 6);
PRAGMA lock_status;
}
} {main reserved temp unlocked aux1 reserved aux2 reserved}
} [list main reserved temp $templockstate aux1 reserved aux2 reserved]
do_test savepoint-10.2.6 {
execsql { SELECT * FROM t2 }
} {5 6}
@ -639,7 +646,7 @@ do_test savepoint-10.2.7 {
} {}
do_test savepoint-10.2.8 {
execsql { PRAGMA lock_status }
} {main reserved temp unlocked aux1 reserved aux2 reserved}
} [list main reserved temp $templockstate aux1 reserved aux2 reserved]
do_test savepoint-10.2.9 {
execsql { SELECT 'a', * FROM t1 UNION ALL SELECT 'b', * FROM t3 }
} {a 1 2 b 3 4}
@ -656,7 +663,7 @@ do_test savepoint-10.2.9 {
} {1 2 5 6 3 4}
do_test savepoint-10.2.9 {
execsql { PRAGMA lock_status }
} {main unlocked temp unlocked aux1 unlocked aux2 unlocked}
} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked]
do_test savepoint-10.2.10 {
execsql {
@ -702,7 +709,7 @@ do_test savepoint-10.2.13 {
} {1 2 5 6 3 4}
do_test savepoint-10.2.14 {
execsql { PRAGMA lock_status }
} {main unlocked temp unlocked aux1 unlocked aux2 unlocked}
} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked]
#-------------------------------------------------------------------------
# The following tests - savepoint-11.* - test the interaction of
@ -808,4 +815,3 @@ do_test savepoint-12.4 {
} {}
finish_test