1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

In the TCL interface, user-defined functions preserve the datatype returned

by the Tcl procedure. (CVS 2453)

FossilOrigin-Name: 99dcba1fb1fdaa2b8bc85046b00c14f6af596e8f
This commit is contained in:
drh
2005-05-05 10:30:29 +00:00
parent c96d8530ca
commit c7f269d551
4 changed files with 51 additions and 14 deletions

View File

@ -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.39 2005/04/03 23:54:45 danielk1977 Exp $
# $Id: tclsqlite.test,v 1.40 2005/05/05 10:30:30 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -318,4 +318,20 @@ do_test tcl-8.3 {
db eval {SELECT * FROM t1 WHERE b IS NULL}
} {30 {}}
# Test the return type of user-defined functions
#
do_test tcl-9.1 {
db function ret_str {return "hi"}
execsql {SELECT typeof(ret_str())}
} {text}
do_test tcl-9.2 {
db function ret_dbl {return [expr {[clock seconds]*0.5}]}
execsql {SELECT typeof(ret_dbl())}
} {real}
do_test tcl-9.3 {
db function ret_int {clock seconds}
execsql {SELECT typeof(ret_int())}
} {integer}
finish_test