aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pragma2.test34
1 files changed, 28 insertions, 6 deletions
diff --git a/test/pragma2.test b/test/pragma2.test
index e2c87019e..c0b4f239e 100644
--- a/test/pragma2.test
+++ b/test/pragma2.test
@@ -138,7 +138,7 @@ do_execsql_test pragma2-4.1 {
PRAGMA cache_spill;
PRAGMA main.cache_spill;
PRAGMA temp.cache_spill;
-} {1 1 1}
+} {2000 2000 2000}
do_execsql_test pragma2-4.2 {
PRAGMA cache_spill=OFF;
PRAGMA cache_spill;
@@ -178,21 +178,43 @@ do_test pragma2-4.4 {
PRAGMA lock_status;
}
} {main exclusive temp unknown} ;# EXCLUSIVE lock due to cache spill
-do_test pragma2-4.5 {
+do_test pragma2-4.5.1 {
db eval {
- COMMIT;
+ ROLLBACK;
PRAGMA cache_spill=OFF;
+ PRAGMA Cache_Spill;
BEGIN;
- UPDATE t1 SET c=c-1;
+ UPDATE t1 SET c=c+1;
+ PRAGMA lock_status;
+ }
+} {0 main reserved temp unknown} ;# No cache spill, so no exclusive lock
+do_test pragma2-4.5.2 {
+ db eval {
+ ROLLBACK;
+ PRAGMA cache_spill=100000;
+ PRAGMA cache_spill;
+ BEGIN;
+ UPDATE t1 SET c=c+1;
+ PRAGMA lock_status;
+ }
+} {100000 main reserved temp unknown} ;# Large cache spill threshold
+do_test pragma2-4.5.3 {
+ db eval {
+ ROLLBACK;
+ PRAGMA cache_spill=25;
+ BEGIN;
+ UPDATE t1 SET c=c+1;
PRAGMA lock_status;
}
-} {main reserved temp unknown} ;# No cache spill, so no exclusive lock
+} {main exclusive temp unknown} ;# Large cache spill, so no exclusive lock
+
# Verify that newly attached databases inherit the cache_spill=OFF
# setting.
#
do_execsql_test pragma2-4.6 {
- COMMIT;
+ ROLLBACK;
+ PRAGMA cache_spill=OFF;
ATTACH 'test2.db' AS aux1;
PRAGMA aux1.cache_size=50;
BEGIN;