summaryrefslogtreecommitdiff
path: root/test/capi3d.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/capi3d.test')
-rw-r--r--test/capi3d.test44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/capi3d.test b/test/capi3d.test
index 746ec20..fb8abe8 100644
--- a/test/capi3d.test
+++ b/test/capi3d.test
@@ -108,6 +108,13 @@ db eval {CREATE TABLE t1(x)}
test_is_readonly capi3d-2.3 {INSERT INTO t1 VALUES(5)} 0
test_is_readonly capi3d-2.4 {UPDATE t1 SET x=x+1 WHERE x<0} 0
test_is_readonly capi3d-2.5 {SELECT * FROM t1} 1
+ifcapable wal {
+ test_is_readonly capi3d-2.6 {PRAGMA journal_mode=WAL} 0
+ test_is_readonly capi3d-2.7 {PRAGMA wal_checkpoint} 0
+}
+test_is_readonly capi3d-2.8 {PRAGMA application_id=1234} 0
+test_is_readonly capi3d-2.9 {VACUUM} 0
+test_is_readonly capi3d-2.10 {PRAGMA integrity_check} 1
do_test capi3-2.99 {
sqlite3_stmt_readonly 0
} 1
@@ -137,4 +144,41 @@ do_test capi3d-3.99 {
sqlite3_stmt_busy 0
} {0}
+#--------------------------------------------------------------------------
+# Test the sqlite3_stmt_busy() function with ROLLBACK statements.
+#
+reset_db
+
+do_execsql_test capi3d-4.1 {
+ CREATE TABLE t4(x,y);
+ BEGIN;
+}
+
+do_test capi3d-4.2.1 {
+ breakpoint
+ set ::s1 [sqlite3_prepare_v2 db "ROLLBACK" -1 notused]
+ sqlite3_step $::s1
+} {SQLITE_DONE}
+
+do_test capi3d-4.2.2 {
+ sqlite3_stmt_busy $::s1
+} {1}
+
+do_catchsql_test capi3d-4.2.3 {
+ VACUUM
+} {1 {cannot VACUUM - SQL statements in progress}}
+
+do_test capi3d-4.2.4 {
+ sqlite3_reset $::s1
+} {SQLITE_OK}
+
+do_catchsql_test capi3d-4.2.5 {
+ VACUUM
+} {0 {}}
+
+do_test capi3d-4.2.6 {
+ sqlite3_finalize $::s1
+} {SQLITE_OK}
+
+
finish_test