aboutsummaryrefslogtreecommitdiff
path: root/test/tableapi.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-01-23 12:52:40 +0000
committerdrh <drh@noemail.net>2008-01-23 12:52:40 +0000
commit01495b992158f6da5568bcc11e82d6844ffff4a8 (patch)
tree4317198de87b54f358a6515089518e65c364a860 /test/tableapi.test
parent7e8b848a60a305231cca0b8cfc7f08be5f0429bd (diff)
downloadsqlite-01495b992158f6da5568bcc11e82d6844ffff4a8.tar.gz
sqlite-01495b992158f6da5568bcc11e82d6844ffff4a8.zip
Improvements to test coverage in the lemon-generated parser and in the
sqlite3_get_table() interface. (CVS 4745) FossilOrigin-Name: 9f95d79daeb5e7f6fd62f3c896dae4d332121d1c
Diffstat (limited to 'test/tableapi.test')
-rw-r--r--test/tableapi.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/tableapi.test b/test/tableapi.test
index 1738291af..327e9e35e 100644
--- a/test/tableapi.test
+++ b/test/tableapi.test
@@ -12,7 +12,7 @@
# focus of this file is testing the sqlite_exec_printf() and
# sqlite_get_table_printf() APIs.
#
-# $Id: tableapi.test,v 1.13 2007/09/12 17:01:45 danielk1977 Exp $
+# $Id: tableapi.test,v 1.14 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -61,6 +61,11 @@ do_test tableapi-2.3.2 {
SELECT * FROM xyz WHERE a>47 ORDER BY a
} {}
} {0 3 2 a b 48 (48) 49 (49) 50 (50)}
+do_test tableapi-2.3.3 {
+ sqlite3_get_table_printf $::dbx {
+ SELECT * FROM xyz WHERE a>47 ORDER BY a; invalid
+ } {}
+} {1 {near "invalid": syntax error}}
do_test tableapi-2.4 {
set manyquote ''''''''
append manyquote $manyquote
@@ -212,6 +217,20 @@ ifcapable schema_pragmas {
} {0 1 1 user_version 0}
}
+ifcapable memdebug {
+ source $testdir/malloc_common.tcl
+ do_malloc_test tableapi-7 -sqlprep {
+ CREATE TABLE t1(a,b);
+ INSERT INTO t1 VALUES(1,2);
+ INSERT INTO t1 VALUES(3,4);
+ INSERT INTO t1 SELECT a+4, b+4 FROM t1;
+ INSERT INTO t1 SELECT a+8, b+8 FROM t1;
+ } -tclbody {
+ set r [sqlite3_get_table_printf db {SELECT rowid, a, b FROM t1} {}]
+ if {[llength $r]<26} {error "out of memory"}
+ }
+}
+
do_test tableapi-99.0 {
sqlite3_close $::dbx
} {SQLITE_OK}