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

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
This commit is contained in:
danielk1977
2007-06-13 16:49:48 +00:00
parent e965ac7773
commit 3fe11f3021
6 changed files with 35 additions and 26 deletions

View File

@ -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