blob: fa363f47f2c51cbd70d8c257445204f93bdee753 [file] [log] [blame]
drh82a48512003-09-06 22:45:20 +00001# 2003 September 6
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library. The
12# focus of this script testing the sqlite_bind API.
13#
danielk1977b3bce662005-01-29 08:32:43 +000014# $Id: bind.test,v 1.28 2005/01/29 08:32:46 danielk1977 Exp $
drh82a48512003-09-06 22:45:20 +000015#
16
17set testdir [file dirname $argv0]
18source $testdir/tester.tcl
19
danielk197717240fd2004-05-26 00:07:25 +000020proc sqlite_step {stmt N VALS COLS} {
21 upvar VALS vals
22 upvar COLS cols
23 set vals [list]
24 set cols [list]
25
26 set rc [sqlite3_step $stmt]
27 for {set i 0} {$i < [sqlite3_column_count $stmt]} {incr i} {
28 lappend cols [sqlite3_column_name $stmt $i]
29 }
30 for {set i 0} {$i < [sqlite3_data_count $stmt]} {incr i} {
drheb2e1762004-05-27 01:53:56 +000031 lappend vals [sqlite3_column_text $stmt $i]
danielk197717240fd2004-05-26 00:07:25 +000032 }
33
34 return $rc
35}
36
drh82a48512003-09-06 22:45:20 +000037do_test bind-1.1 {
38 db close
drhef4ac8f2004-06-19 00:16:31 +000039 set DB [sqlite3 db test.db]
drh2c6674c2004-08-25 04:07:01 +000040 execsql {CREATE TABLE t1(a,b,c);}
41 set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES(:1,?,:abc)} -1 TAIL]
drh82a48512003-09-06 22:45:20 +000042 set TAIL
43} {}
drh75f6a032004-07-15 14:15:00 +000044do_test bind-1.1.1 {
45 sqlite3_bind_parameter_count $VM
46} 3
drh895d7472004-08-20 16:02:39 +000047do_test bind-1.1.2 {
48 sqlite3_bind_parameter_name $VM 1
drh2c6674c2004-08-25 04:07:01 +000049} {:1}
drh895d7472004-08-20 16:02:39 +000050do_test bind-1.1.3 {
51 sqlite3_bind_parameter_name $VM 2
52} {}
53do_test bind-1.1.4 {
54 sqlite3_bind_parameter_name $VM 3
drh2c6674c2004-08-25 04:07:01 +000055} {:abc}
drh82a48512003-09-06 22:45:20 +000056do_test bind-1.2 {
57 sqlite_step $VM N VALUES COLNAMES
58} {SQLITE_DONE}
59do_test bind-1.3 {
60 execsql {SELECT rowid, * FROM t1}
61} {1 {} {} {}}
62do_test bind-1.4 {
danielk1977106bb232004-05-21 10:08:53 +000063 sqlite3_reset $VM
drh82a48512003-09-06 22:45:20 +000064 sqlite_bind $VM 1 {test value 1} normal
65 sqlite_step $VM N VALUES COLNAMES
66} SQLITE_DONE
67do_test bind-1.5 {
68 execsql {SELECT rowid, * FROM t1}
69} {1 {} {} {} 2 {test value 1} {} {}}
70do_test bind-1.6 {
danielk1977106bb232004-05-21 10:08:53 +000071 sqlite3_reset $VM
drh82a48512003-09-06 22:45:20 +000072 sqlite_bind $VM 3 {'test value 2'} normal
73 sqlite_step $VM N VALUES COLNAMES
74} SQLITE_DONE
75do_test bind-1.7 {
76 execsql {SELECT rowid, * FROM t1}
77} {1 {} {} {} 2 {test value 1} {} {} 3 {test value 1} {} {'test value 2'}}
78do_test bind-1.8 {
danielk1977106bb232004-05-21 10:08:53 +000079 sqlite3_reset $VM
drh82a48512003-09-06 22:45:20 +000080 set sqlite_static_bind_value 123
81 sqlite_bind $VM 1 {} static
82 sqlite_bind $VM 2 {abcdefg} normal
83 sqlite_bind $VM 3 {} null
84 execsql {DELETE FROM t1}
85 sqlite_step $VM N VALUES COLNAMES
86 execsql {SELECT rowid, * FROM t1}
87} {1 123 abcdefg {}}
88do_test bind-1.9 {
danielk1977106bb232004-05-21 10:08:53 +000089 sqlite3_reset $VM
drh82a48512003-09-06 22:45:20 +000090 sqlite_bind $VM 1 {456} normal
91 sqlite_step $VM N VALUES COLNAMES
92 execsql {SELECT rowid, * FROM t1}
93} {1 123 abcdefg {} 2 456 abcdefg {}}
94
drh82a48512003-09-06 22:45:20 +000095do_test bind-1.99 {
danielk1977106bb232004-05-21 10:08:53 +000096 sqlite3_finalize $VM
danielk19773cf86062004-05-26 10:11:05 +000097} SQLITE_OK
drh82a48512003-09-06 22:45:20 +000098
drh6bf89572004-11-03 16:27:01 +000099# Prepare the statement in different ways depending on whether or not
100# the $var processing is compiled into the library.
101#
102ifcapable {tclvar} {
103 do_test bind-2.1 {
104 execsql {
105 DELETE FROM t1;
106 }
drh48e5aa22005-01-11 17:46:41 +0000107 set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES($one,$::two,${x{y}z})}\
108 -1 TX]
drh6bf89572004-11-03 16:27:01 +0000109 set TX
110 } {}
111 set v1 {$one}
112 set v2 {$::two}
drh48e5aa22005-01-11 17:46:41 +0000113 set v3 {${x{y}z}}
drh6bf89572004-11-03 16:27:01 +0000114}
115ifcapable {!tclvar} {
116 do_test bind-2.1 {
117 execsql {
118 DELETE FROM t1;
119 }
120 set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES(:one,:two,:_)} -1 TX]
121 set TX
122 } {}
123 set v1 {:one}
124 set v2 {:two}
125 set v3 {:_}
126}
127
drh895d7472004-08-20 16:02:39 +0000128do_test bind-2.1.1 {
129 sqlite3_bind_parameter_count $VM
130} 3
131do_test bind-2.1.2 {
132 sqlite3_bind_parameter_name $VM 1
drh6bf89572004-11-03 16:27:01 +0000133} $v1
drh895d7472004-08-20 16:02:39 +0000134do_test bind-2.1.3 {
135 sqlite3_bind_parameter_name $VM 2
drh6bf89572004-11-03 16:27:01 +0000136} $v2
drh895d7472004-08-20 16:02:39 +0000137do_test bind-2.1.4 {
138 sqlite3_bind_parameter_name $VM 3
drh6bf89572004-11-03 16:27:01 +0000139} $v3
drhfa6bc002004-09-07 16:19:52 +0000140do_test bind-2.1.5 {
drh6bf89572004-11-03 16:27:01 +0000141 sqlite3_bind_parameter_index $VM $v1
drhfa6bc002004-09-07 16:19:52 +0000142} 1
143do_test bind-2.1.6 {
drh6bf89572004-11-03 16:27:01 +0000144 sqlite3_bind_parameter_index $VM $v2
drhfa6bc002004-09-07 16:19:52 +0000145} 2
146do_test bind-2.1.7 {
drh6bf89572004-11-03 16:27:01 +0000147 sqlite3_bind_parameter_index $VM $v3
drhfa6bc002004-09-07 16:19:52 +0000148} 3
149do_test bind-2.1.8 {
150 sqlite3_bind_parameter_index $VM {:hi}
151} 0
danielk197751e3d8e2004-05-20 01:12:34 +0000152
153# 32 bit Integers
154do_test bind-2.2 {
drh241db312004-06-22 12:46:53 +0000155 sqlite3_bind_int $VM 1 123
156 sqlite3_bind_int $VM 2 456
157 sqlite3_bind_int $VM 3 789
danielk197751e3d8e2004-05-20 01:12:34 +0000158 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000159 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000160 execsql {SELECT rowid, * FROM t1}
161} {1 123 456 789}
162do_test bind-2.3 {
drh241db312004-06-22 12:46:53 +0000163 sqlite3_bind_int $VM 2 -2000000000
164 sqlite3_bind_int $VM 3 2000000000
danielk197751e3d8e2004-05-20 01:12:34 +0000165 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000166 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000167 execsql {SELECT rowid, * FROM t1}
168} {1 123 456 789 2 123 -2000000000 2000000000}
169do_test bind-2.4 {
danielk197735bb9d02004-05-24 12:55:54 +0000170 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
171} {integer integer integer integer integer integer}
danielk197751e3d8e2004-05-20 01:12:34 +0000172do_test bind-2.5 {
173 execsql {
174 DELETE FROM t1;
175 }
176} {}
177
178# 64 bit Integers
179do_test bind-3.1 {
180 sqlite3_bind_int64 $VM 1 32
181 sqlite3_bind_int64 $VM 2 -2000000000000
182 sqlite3_bind_int64 $VM 3 2000000000000
183 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000184 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000185 execsql {SELECT rowid, * FROM t1}
186} {1 32 -2000000000000 2000000000000}
187do_test bind-3.2 {
danielk197735bb9d02004-05-24 12:55:54 +0000188 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
189} {integer integer integer}
danielk197751e3d8e2004-05-20 01:12:34 +0000190do_test bind-3.3 {
191 execsql {
192 DELETE FROM t1;
193 }
194} {}
195
196# Doubles
197do_test bind-4.1 {
198 sqlite3_bind_double $VM 1 1234.1234
199 sqlite3_bind_double $VM 2 0.00001
200 sqlite3_bind_double $VM 3 123456789
201 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000202 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000203 execsql {SELECT rowid, * FROM t1}
drh92febd92004-08-20 18:34:20 +0000204} {1 1234.1234 1e-05 123456789.0}
danielk197751e3d8e2004-05-20 01:12:34 +0000205do_test bind-4.2 {
danielk197735bb9d02004-05-24 12:55:54 +0000206 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
207} {real real real}
danielk197751e3d8e2004-05-20 01:12:34 +0000208do_test bind-4.3 {
209 execsql {
210 DELETE FROM t1;
211 }
212} {}
213
214# NULL
215do_test bind-5.1 {
216 sqlite3_bind_null $VM 1
217 sqlite3_bind_null $VM 2
218 sqlite3_bind_null $VM 3
219 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000220 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000221 execsql {SELECT rowid, * FROM t1}
222} {1 {} {} {}}
223do_test bind-5.2 {
danielk197735bb9d02004-05-24 12:55:54 +0000224 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
225} {null null null}
danielk197751e3d8e2004-05-20 01:12:34 +0000226do_test bind-5.3 {
227 execsql {
228 DELETE FROM t1;
229 }
230} {}
231
232# UTF-8 text
233do_test bind-6.1 {
234 sqlite3_bind_text $VM 1 hellothere 5
danielk1977c572ef72004-05-27 09:28:41 +0000235 sqlite3_bind_text $VM 2 ".." 1
danielk197751e3d8e2004-05-20 01:12:34 +0000236 sqlite3_bind_text $VM 3 world -1
237 sqlite_step $VM N VALUES COLNAMES
danielk1977106bb232004-05-21 10:08:53 +0000238 sqlite3_reset $VM
danielk197751e3d8e2004-05-20 01:12:34 +0000239 execsql {SELECT rowid, * FROM t1}
240} {1 hello . world}
241do_test bind-6.2 {
danielk197735bb9d02004-05-24 12:55:54 +0000242 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
243} {text text text}
danielk197751e3d8e2004-05-20 01:12:34 +0000244do_test bind-6.3 {
245 execsql {
246 DELETE FROM t1;
247 }
248} {}
249
250# UTF-16 text
drh6c626082004-11-14 21:56:29 +0000251ifcapable {utf16} {
252 do_test bind-7.1 {
253 sqlite3_bind_text16 $VM 1 [encoding convertto unicode hellothere] 10
254 sqlite3_bind_text16 $VM 2 [encoding convertto unicode ""] 0
255 sqlite3_bind_text16 $VM 3 [encoding convertto unicode world] 10
256 sqlite_step $VM N VALUES COLNAMES
257 sqlite3_reset $VM
258 execsql {SELECT rowid, * FROM t1}
259 } {1 hello {} world}
260 do_test bind-7.2 {
261 execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1}
262 } {text text text}
263}
danielk197751e3d8e2004-05-20 01:12:34 +0000264do_test bind-7.3 {
265 execsql {
266 DELETE FROM t1;
267 }
268} {}
269
danielk19776622cce2004-05-20 11:00:52 +0000270# Test that the 'out of range' error works.
271do_test bind-8.1 {
272 catch { sqlite3_bind_null $VM 0 }
273} {1}
274do_test bind-8.2 {
275 sqlite3_errmsg $DB
drhb08153d2004-11-20 20:18:55 +0000276} {bind or column index out of range}
drh6c626082004-11-14 21:56:29 +0000277ifcapable {utf16} {
278 do_test bind-8.3 {
279 encoding convertfrom unicode [sqlite3_errmsg16 $DB]
drhb08153d2004-11-20 20:18:55 +0000280 } {bind or column index out of range}
drh6c626082004-11-14 21:56:29 +0000281}
danielk19776622cce2004-05-20 11:00:52 +0000282do_test bind-8.4 {
283 sqlite3_bind_null $VM 1
284 sqlite3_errmsg $DB
285} {not an error}
286do_test bind-8.5 {
287 catch { sqlite3_bind_null $VM 4 }
288} {1}
289do_test bind-8.6 {
290 sqlite3_errmsg $DB
drhb08153d2004-11-20 20:18:55 +0000291} {bind or column index out of range}
drh6c626082004-11-14 21:56:29 +0000292ifcapable {utf16} {
293 do_test bind-8.7 {
294 encoding convertfrom unicode [sqlite3_errmsg16 $DB]
drhb08153d2004-11-20 20:18:55 +0000295 } {bind or column index out of range}
drh6c626082004-11-14 21:56:29 +0000296}
danielk19776622cce2004-05-20 11:00:52 +0000297
danielk1977f4618892004-06-28 13:09:11 +0000298do_test bind-8.8 {
299 catch { sqlite3_bind_blob $VM 0 "abc" 3 }
300} {1}
301do_test bind-8.9 {
302 catch { sqlite3_bind_blob $VM 4 "abc" 3 }
303} {1}
304do_test bind-8.10 {
305 catch { sqlite3_bind_text $VM 0 "abc" 3 }
306} {1}
drh6c626082004-11-14 21:56:29 +0000307ifcapable {utf16} {
308 do_test bind-8.11 {
309 catch { sqlite3_bind_text16 $VM 4 "abc" 2 }
310 } {1}
311}
danielk1977f4618892004-06-28 13:09:11 +0000312do_test bind-8.12 {
313 catch { sqlite3_bind_int $VM 0 5 }
314} {1}
315do_test bind-8.13 {
316 catch { sqlite3_bind_int $VM 4 5 }
317} {1}
318do_test bind-8.14 {
319 catch { sqlite3_bind_double $VM 0 5.0 }
320} {1}
321do_test bind-8.15 {
322 catch { sqlite3_bind_double $VM 4 6.0 }
323} {1}
danielk19776622cce2004-05-20 11:00:52 +0000324
drhfa6bc002004-09-07 16:19:52 +0000325do_test bind-8.99 {
danielk1977106bb232004-05-21 10:08:53 +0000326 sqlite3_finalize $VM
danielk19773cf86062004-05-26 10:11:05 +0000327} SQLITE_OK
danielk197751e3d8e2004-05-20 01:12:34 +0000328
drhfa6bc002004-09-07 16:19:52 +0000329do_test bind-9.1 {
330 execsql {
331 CREATE TABLE t2(a,b,c,d,e,f);
332 }
333 set rc [catch {
334 sqlite3_prepare $DB {
335 INSERT INTO t2(a) VALUES(?0)
336 } -1 TAIL
337 } msg]
338 lappend rc $msg
339} {1 {(1) variable number must be between ?1 and ?999}}
340do_test bind-9.2 {
341 set rc [catch {
342 sqlite3_prepare $DB {
343 INSERT INTO t2(a) VALUES(?1000)
344 } -1 TAIL
345 } msg]
346 lappend rc $msg
347} {1 {(1) variable number must be between ?1 and ?999}}
348do_test bind-9.3 {
349 set VM [
350 sqlite3_prepare $DB {
351 INSERT INTO t2(a,b) VALUES(?1,?999)
352 } -1 TAIL
353 ]
354 sqlite3_bind_parameter_count $VM
355} {999}
356catch {sqlite3_finalize $VM}
357do_test bind-9.4 {
358 set VM [
359 sqlite3_prepare $DB {
360 INSERT INTO t2(a,b,c,d) VALUES(?1,?999,?,?)
361 } -1 TAIL
362 ]
363 sqlite3_bind_parameter_count $VM
364} {1001}
365do_test bind-9.5 {
366 sqlite3_bind_int $VM 1 1
367 sqlite3_bind_int $VM 999 999
368 sqlite3_bind_int $VM 1000 1000
369 sqlite3_bind_int $VM 1001 1001
370 sqlite3_step $VM
371} SQLITE_DONE
372do_test bind-9.6 {
373 sqlite3_finalize $VM
374} SQLITE_OK
375do_test bind-9.7 {
376 execsql {SELECT * FROM t2}
377} {1 999 1000 1001 {} {}}
danielk197751e3d8e2004-05-20 01:12:34 +0000378
drh6bf89572004-11-03 16:27:01 +0000379ifcapable {tclvar} {
380 do_test bind-10.1 {
381 catch {sqlite3_finalize $VM}
382 set VM [
383 sqlite3_prepare $DB {
384 INSERT INTO t2(a,b,c,d,e,f) VALUES(:abc,$abc,:abc,$ab,$abc,:abc)
385 } -1 TAIL
386 ]
387 sqlite3_bind_parameter_count $VM
388 } 3
389 set v1 {$abc}
390 set v2 {$ab}
391}
392ifcapable {!tclvar} {
393 do_test bind-10.1 {
394 catch {sqlite3_finalize $VM}
395 set VM [
396 sqlite3_prepare $DB {
397 INSERT INTO t2(a,b,c,d,e,f) VALUES(:abc,:xyz,:abc,:xy,:xyz,:abc)
398 } -1 TAIL
399 ]
400 sqlite3_bind_parameter_count $VM
401 } 3
402 set v1 {:xyz}
403 set v2 {:xy}
404}
drhfa6bc002004-09-07 16:19:52 +0000405do_test bind-10.2 {
406 sqlite3_bind_parameter_index $VM :abc
407} 1
408do_test bind-10.3 {
drh6bf89572004-11-03 16:27:01 +0000409 sqlite3_bind_parameter_index $VM $v1
drhfa6bc002004-09-07 16:19:52 +0000410} 2
411do_test bind-10.4 {
drh6bf89572004-11-03 16:27:01 +0000412 sqlite3_bind_parameter_index $VM $v2
drhfa6bc002004-09-07 16:19:52 +0000413} 3
414do_test bind-10.5 {
415 sqlite3_bind_parameter_name $VM 1
416} :abc
417do_test bind-10.6 {
418 sqlite3_bind_parameter_name $VM 2
drh6bf89572004-11-03 16:27:01 +0000419} $v1
drhfa6bc002004-09-07 16:19:52 +0000420do_test bind-10.7 {
421 sqlite3_bind_parameter_name $VM 3
drh6bf89572004-11-03 16:27:01 +0000422} $v2
drhc5cdca62005-01-11 16:54:14 +0000423do_test bind-10.7.1 {
424 sqlite3_bind_parameter_name 0 1 ;# Ignore if VM is NULL
425} {}
426do_test bind-10.7.2 {
427 sqlite3_bind_parameter_name $VM 0 ;# Ignore if index too small
428} {}
429do_test bind-10.7.3 {
430 sqlite3_bind_parameter_name $VM 4 ;# Ignore if index is too big
431} {}
drhfa6bc002004-09-07 16:19:52 +0000432do_test bind-10.8 {
433 sqlite3_bind_int $VM 1 1
434 sqlite3_bind_int $VM 2 2
435 sqlite3_bind_int $VM 3 3
436 sqlite3_step $VM
437} SQLITE_DONE
drhc5cdca62005-01-11 16:54:14 +0000438do_test bind-10.8.1 {
439 # Binding attempts after program start should fail
440 set rc [catch {
441 sqlite3_bind_int $VM 1 1
442 } msg]
443 lappend rc $msg
444} {1 {}}
drhfa6bc002004-09-07 16:19:52 +0000445do_test bind-10.9 {
446 sqlite3_finalize $VM
447} SQLITE_OK
448do_test bind-10.10 {
449 execsql {SELECT * FROM t2}
450} {1 999 1000 1001 {} {} 1 2 1 3 2 1}
drh82a48512003-09-06 22:45:20 +0000451
drh971a7c82004-09-24 12:48:12 +0000452# Ticket #918
453#
454do_test bind-10.11 {
455 catch {sqlite3_finalize $VM}
456 set VM [
457 sqlite3_prepare $DB {
458 INSERT INTO t2(a,b,c,d,e,f) VALUES(:abc,?,?4,:pqr,:abc,?4)
459 } -1 TAIL
460 ]
461 sqlite3_bind_parameter_count $VM
462} 5
drhc5cdca62005-01-11 16:54:14 +0000463do_test bind-10.11.1 {
464 sqlite3_bind_parameter_index 0 :xyz ;# ignore NULL VM arguments
465} 0
drh971a7c82004-09-24 12:48:12 +0000466do_test bind-10.12 {
467 sqlite3_bind_parameter_index $VM :xyz
468} 0
469do_test bind-10.13 {
470 sqlite3_bind_parameter_index $VM {}
471} 0
472do_test bind-10.14 {
473 sqlite3_bind_parameter_index $VM :pqr
474} 5
475do_test bind-10.15 {
476 sqlite3_bind_parameter_index $VM ?4
477} 4
478do_test bind-10.16 {
479 sqlite3_bind_parameter_name $VM 1
480} :abc
danielk1977b3bce662005-01-29 08:32:43 +0000481do_test bind-10.17 {
drh971a7c82004-09-24 12:48:12 +0000482 sqlite3_bind_parameter_name $VM 2
483} {}
danielk1977b3bce662005-01-29 08:32:43 +0000484do_test bind-10.18 {
drh971a7c82004-09-24 12:48:12 +0000485 sqlite3_bind_parameter_name $VM 3
486} {}
danielk1977b3bce662005-01-29 08:32:43 +0000487do_test bind-10.19 {
drh971a7c82004-09-24 12:48:12 +0000488 sqlite3_bind_parameter_name $VM 4
489} {?4}
danielk1977b3bce662005-01-29 08:32:43 +0000490do_test bind-10.20 {
drh971a7c82004-09-24 12:48:12 +0000491 sqlite3_bind_parameter_name $VM 5
492} :pqr
493catch {sqlite3_finalize $VM}
494
drh48e5aa22005-01-11 17:46:41 +0000495# Make sure we catch an unterminated "(" in a Tcl-style variable name
496#
danielk19774489f9b2005-01-20 02:17:01 +0000497ifcapable tclvar {
498 do_test bind-11.1 {
499 catchsql {SELECT * FROM sqlite_master WHERE name=$abc(123 and sql NOT NULL;}
500 } {1 {unrecognized token: "$abc(123"}}
501}
drh48e5aa22005-01-11 17:46:41 +0000502
drh82a48512003-09-06 22:45:20 +0000503finish_test