diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-06-13 16:49:48 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-06-13 16:49:48 +0000 |
commit | 3fe11f3021ba0b17da63b81c6055da20b4596e21 (patch) | |
tree | c6f963b95bcb99da98faa5afa4c8d65f0b00ce55 /test/interrupt.test | |
parent | e965ac77737585dce3b58e1e318856020920bf5e (diff) | |
download | sqlite-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/interrupt.test')
-rw-r--r-- | test/interrupt.test | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/interrupt.test b/test/interrupt.test index 520580357..b348baa6b 100644 --- a/test/interrupt.test +++ b/test/interrupt.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is the sqlite_interrupt() API. # -# $Id: interrupt.test,v 1.14 2007/05/15 16:51:37 drh Exp $ +# $Id: interrupt.test,v 1.15 2007/06/13 16:49:49 danielk1977 Exp $ set testdir [file dirname $argv0] @@ -122,6 +122,10 @@ integrity_check interrupt-2.6 # and that transaction is later rolled back, the internal schema tables do # not reset. # +# UPDATE: Interrupting a DML statement in the middle of a transaction now +# causes the transaction to roll back. Leaving the transaction open after +# an SQL statement was interrupted halfway through risks database corruption. +# ifcapable tempdb { for {set i 1} {$i<50} {incr i 5} { do_test interrupt-3.$i.1 { @@ -141,12 +145,12 @@ ifcapable tempdb { execsql { SELECT name FROM sqlite_temp_master; } - } {t2} + } {} do_test interrupt-3.$i.4 { catchsql { ROLLBACK } - } {0 {}} + } {1 {cannot rollback - no transaction is active}} do_test interrupt-3.$i.5 { catchsql {SELECT name FROM sqlite_temp_master}; execsql { |