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

Fix the onecolumn method in the TCL interface so that it works the same

as the eval method in all ways except for returning just the first value
in the result set. (CVS 1944)

FossilOrigin-Name: f323e4f86a08fe6448cbd4ff7cab459e8039d9f1
This commit is contained in:
drh
2004-09-07 13:20:35 +00:00
parent af805ca035
commit 1807ce37b8
4 changed files with 98 additions and 111 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.30 2004/08/20 18:34:20 drh Exp $
# $Id: tclsqlite.test,v 1.31 2004/09/07 13:20:35 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -170,6 +170,24 @@ do_test tcl-3.4 {
set rc [catch {db onecolumn {SELECT bogus}} errmsg]
lappend rc $errmsg
} {1 {no such column: bogus}}
do_test tcl-3.5 {
set b 50
set rc [catch {db one {SELECT * FROM t1 WHERE b>$b}} msg]
lappend rc $msg
} {0 41}
do_test tcl-3.6 {
set b 500
set rc [catch {db one {SELECT * FROM t1 WHERE b>$b}} msg]
lappend rc $msg
} {0 {}}
do_test tcl-3.7 {
set b 500
set rc [catch {db one {
INSERT INTO t1 VALUES(99,510);
SELECT * FROM t1 WHERE b>$b
}} msg]
lappend rc $msg
} {0 99}
# Turn the busy handler on and off
#