mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Tcl interface uses Tcl_Objs to implement user-defined functions, thus allowing
BLOB values to be transferred correctly. Ticket #1304. (CVS 2530) FossilOrigin-Name: 514aaab3f99637ebb8b6e352f4e29738102579b4
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
# interface is pretty well tested. This file contains some addition
|
||||
# tests for fringe issues that the main test suite does not cover.
|
||||
#
|
||||
# $Id: tclsqlite.test,v 1.40 2005/05/05 10:30:30 drh Exp $
|
||||
# $Id: tclsqlite.test,v 1.41 2005/06/26 17:55:34 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -333,5 +333,20 @@ do_test tcl-9.3 {
|
||||
execsql {SELECT typeof(ret_int())}
|
||||
} {integer}
|
||||
|
||||
# Recursive calls to the same user-defined function
|
||||
#
|
||||
do_test tcl-9.10 {
|
||||
proc userfunc_r1 {n} {
|
||||
if {$n<=0} {return 0}
|
||||
set nm1 [expr {$n-1}]
|
||||
return [expr {[db eval {SELECT r1($nm1)}]+$n}]
|
||||
}
|
||||
db function r1 userfunc_r1
|
||||
execsql {SELECT r1(10)}
|
||||
} {55}
|
||||
do_test tcl-9.11 {
|
||||
execsql {SELECT r1(100)}
|
||||
} {5050}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user