aboutsummaryrefslogtreecommitdiff
path: root/test/progress.test
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2007-06-13 16:49:48 +0000
committerdanielk1977 <danielk1977@noemail.net>2007-06-13 16:49:48 +0000
commit3fe11f3021ba0b17da63b81c6055da20b4596e21 (patch)
treec6f963b95bcb99da98faa5afa4c8d65f0b00ce55 /test/progress.test
parente965ac77737585dce3b58e1e318856020920bf5e (diff)
downloadsqlite-3fe11f3021ba0b17da63b81c6055da20b4596e21.tar.gz
sqlite-3fe11f3021ba0b17da63b81c6055da20b4596e21.zip
Have queries interrupted by the progress-handler return SQLITE_INTERRUPT. Rollback any active transaction if a DML statement returns SQLITE_INTERRUPT. (CVS 4061)
FossilOrigin-Name: 33454b5691637da7ded7d18d7f5726b796260c6b
Diffstat (limited to 'test/progress.test')
-rwxr-xr-xtest/progress.test19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/progress.test b/test/progress.test
index 5616a7afd..ca30b26ab 100755
--- a/test/progress.test
+++ b/test/progress.test
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the 'progress callback'.
#
-# $Id: progress.test,v 1.6 2006/05/26 19:57:20 drh Exp $
+# $Id: progress.test,v 1.7 2007/06/13 16:49:49 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -97,8 +97,11 @@ do_test progress-1.2 {
}
} 10
-# Test that an active transaction remains active and not rolled back after the
-# progress query abandons a query.
+# Test that an active transaction remains active and not rolled back
+# after the progress query abandons a query.
+#
+# UPDATE: It is now recognised that this is a sure route to database
+# corruption. So the transaction is rolled back.
do_test progress-1.3 {
db progress 0 ""
@@ -111,11 +114,13 @@ do_test progress-1.3 {
INSERT INTO t1 VALUES(12)
}
db progress 0 ""
- execsql COMMIT
+ catchsql COMMIT
+} {1 {cannot commit - no transaction is active}}
+do_test progress-1.3.1 {
execsql {
SELECT count(*) FROM t1
}
-} 11
+} 10
# Check that a value of 0 for N means no progress callback
do_test progress-1.4 {
@@ -143,9 +148,9 @@ do_test progress-1.5 {
db eval {
SELECT sum(a) FROM t1
}
-} {66}
+} {55}
do_test progress-1.6 {
set ::rx
-} {11}
+} {10}
finish_test