aboutsummaryrefslogtreecommitdiff
path: root/test/tclsqlite.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-06-13 12:34:38 +0000
committerdrh <drh@noemail.net>2016-06-13 12:34:38 +0000
commitedc4024b9da4374f78d5dfb8e108144415e7467e (patch)
treeefbf92e99513a8644b75facd9a260fd3bf9208d3 /test/tclsqlite.test
parent4d249e61289c76b41a880126ceb44bf97e14fb8b (diff)
downloadsqlite-edc4024b9da4374f78d5dfb8e108144415e7467e.tar.gz
sqlite-edc4024b9da4374f78d5dfb8e108144415e7467e.zip
Fix the "onecolumn" and "exists" methods of the TCL interface so that they
work in combination with the "profile" callback. FossilOrigin-Name: d362ba157f993fc74a590cf15a9a2fa589278dd7
Diffstat (limited to 'test/tclsqlite.test')
-rw-r--r--test/tclsqlite.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/tclsqlite.test b/test/tclsqlite.test
index 44d5c5634..767dd01be 100644
--- a/test/tclsqlite.test
+++ b/test/tclsqlite.test
@@ -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