mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Add a new sqlite3_is_interrupted() interface that can be used by long-running
app-defined functions and similar to see if they need to exit early due to an sqlite3_interrupt() call. FossilOrigin-Name: d030f341369b7f32789cbcf3d0ad9a2ac5cad99a56dac7dfe68b7f06dc339b17
This commit is contained in:
@ -94,14 +94,28 @@ ifcapable {vacuum && !default_autovacuum} {
|
||||
} 1
|
||||
}
|
||||
ifcapable {explain} {
|
||||
do_test interrupt-2.5 {
|
||||
do_test interrupt-2.5.1 {
|
||||
sqlite3_is_interrupted $DB
|
||||
} {0}
|
||||
do_test interrupt-2.5.2 {
|
||||
unset -nocomplain ::interrupt_count
|
||||
set ::interrupt_count 0
|
||||
set sql {EXPLAIN SELECT max(a,b), a, b FROM t1}
|
||||
execsql $sql
|
||||
set rc [catch {db eval $sql {sqlite3_interrupt $DB}} msg]
|
||||
set rc [catch {db eval $sql {
|
||||
sqlite3_interrupt $DB;
|
||||
incr ::interrupt_count [sqlite3_is_interrupted $DB];
|
||||
}} msg]
|
||||
lappend rc $msg
|
||||
} {1 interrupted}
|
||||
do_test interrupt-2.5.3 {
|
||||
set ::interrupt_count
|
||||
} {1}
|
||||
}
|
||||
integrity_check interrupt-2.6
|
||||
do_test interrupt-2.7 {
|
||||
sqlite3_is_interrupted $DB
|
||||
} {0}
|
||||
|
||||
# Ticket #594. If an interrupt occurs in the middle of a transaction
|
||||
# and that transaction is later rolled back, the internal schema tables do
|
||||
|
Reference in New Issue
Block a user