mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix the "onecolumn" and "exists" methods of the TCL interface so that they
work in combination with the "profile" callback. FossilOrigin-Name: d362ba157f993fc74a590cf15a9a2fa589278dd7
This commit is contained in:
@ -635,6 +635,39 @@ do_test tcl-14.2 {
|
||||
db one {SELECT x FROM t6 WHERE xCall()!='value'}
|
||||
} {}
|
||||
|
||||
# Verify that the "exists" and "onecolumn" methods work when
|
||||
# a "profile" is registered.
|
||||
#
|
||||
catch {db close}
|
||||
sqlite3 db :memory:
|
||||
proc noop-profile {args} {
|
||||
return
|
||||
}
|
||||
do_test tcl-15.0 {
|
||||
db eval {CREATE TABLE t1(a); INSERT INTO t1 VALUES(1),(2),(3);}
|
||||
db onecolumn {SELECT a FROM t1 WHERE a>2}
|
||||
} {3}
|
||||
do_test tcl-15.1 {
|
||||
db exists {SELECT a FROM t1 WHERE a>2}
|
||||
} {1}
|
||||
do_test tcl-15.2 {
|
||||
db exists {SELECT a FROM t1 WHERE a>3}
|
||||
} {0}
|
||||
db profile noop-profile
|
||||
do_test tcl-15.3 {
|
||||
db onecolumn {SELECT a FROM t1 WHERE a>2}
|
||||
} {3}
|
||||
do_test tcl-15.4 {
|
||||
db exists {SELECT a FROM t1 WHERE a>2}
|
||||
} {1}
|
||||
do_test tcl-15.5 {
|
||||
db exists {SELECT a FROM t1 WHERE a>3}
|
||||
} {0}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user