mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Permit sqlite_exec() to be called from within user-defined functions. (CVS 1166)
FossilOrigin-Name: 03636c94a542b1f90a3acfbe65a9c2976872073f
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
# This file implements tests for the SQLITE_MISUSE detection logic.
|
||||
# This test file leaks memory and file descriptors.
|
||||
#
|
||||
# $Id: misuse.test,v 1.3 2002/05/21 11:38:12 drh Exp $
|
||||
# $Id: misuse.test,v 1.4 2004/01/07 19:24:48 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -41,19 +41,23 @@ do_test misuse-1.3 {
|
||||
# Use the x_sqlite_exec() SQL function to simulate the effect of two
|
||||
# threads trying to use the same database at the same time.
|
||||
#
|
||||
# It used to be prohibited to invoke sqlite_exec() from within a function,
|
||||
# but that has changed. The following tests used to cause errors but now
|
||||
# they do not.
|
||||
#
|
||||
do_test misuse-1.4 {
|
||||
sqlite_exec_printf $::DB {
|
||||
SELECT x_sqlite_exec('SELECT * FROM t1');
|
||||
SELECT x_sqlite_exec('SELECT * FROM t1') AS xyz;
|
||||
} {}
|
||||
} {21 {library routine called out of sequence}}
|
||||
} {0 {xyz {1 2}}}
|
||||
do_test misuse-1.5 {
|
||||
sqlite_exec_printf $::DB {SELECT * FROM t1} {}
|
||||
} {21 {library routine called out of sequence}}
|
||||
} {0 {a b 1 2}}
|
||||
do_test misuse-1.6 {
|
||||
catchsql {
|
||||
SELECT * FROM t1
|
||||
}
|
||||
} {1 {library routine called out of sequence}}
|
||||
} {0 {1 2}}
|
||||
|
||||
# Attempt to register a new SQL function while an sqlite_exec() is active.
|
||||
#
|
||||
|
Reference in New Issue
Block a user