mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Allow SQL statements to be executed from within a progress callback.
Be warned, however, that the progress callback might be called recursively in this case. It is up to the program to disable the progress callback to prevent recursive invocations. Ticket #1827. (CVS 3193) FossilOrigin-Name: ffc4730c05ea64b8c32f64b323db9b96b26bcb88
This commit is contained in:
@ -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.5 2005/01/20 02:17:02 danielk1977 Exp $
|
||||
# $Id: progress.test,v 1.6 2006/05/26 19:57:20 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -129,4 +129,23 @@ do_test progress-1.4 {
|
||||
|
||||
db progress 0 ""
|
||||
|
||||
# Make sure other queries can be run from within the progress
|
||||
# handler. Ticket #1827
|
||||
#
|
||||
do_test progress-1.5 {
|
||||
set rx 0
|
||||
proc set_rx {args} {
|
||||
db progress 0 {}
|
||||
set ::rx [db eval {SELECT count(*) FROM t1}]
|
||||
return [expr 0]
|
||||
}
|
||||
db progress 10 set_rx
|
||||
db eval {
|
||||
SELECT sum(a) FROM t1
|
||||
}
|
||||
} {66}
|
||||
do_test progress-1.6 {
|
||||
set ::rx
|
||||
} {11}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user