Index: test/bind.test ================================================================== --- test/bind.test +++ test/bind.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_bind API. # -# $Id: bind.test,v 1.24 2005/01/11 16:54:15 drh Exp $ +# $Id: bind.test,v 1.25 2005/01/11 17:46:42 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -102,16 +102,17 @@ ifcapable {tclvar} { do_test bind-2.1 { execsql { DELETE FROM t1; } - set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES($one,$::two,${x})} -1 TX] + set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES($one,$::two,${x{y}z})}\ + -1 TX] set TX } {} set v1 {$one} set v2 {$::two} - set v3 {${x}} + set v3 {${x{y}z}} } ifcapable {!tclvar} { do_test bind-2.1 { execsql { DELETE FROM t1; @@ -488,7 +489,14 @@ } {?4} do_test bind-10.16 { sqlite3_bind_parameter_name $VM 5 } :pqr catch {sqlite3_finalize $VM} + +# Make sure we catch an unterminated "(" in a Tcl-style variable name +# +do_test bind-11.1 { + catchsql {SELECT * FROM sqlite_master WHERE name=$abc(123 and sql NOT NULL;} +} {1 {unrecognized token: "$abc(123"}} + finish_test Index: test/expr.test ================================================================== --- test/expr.test +++ test/expr.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing expressions. # -# $Id: expr.test,v 1.40 2004/11/17 16:41:29 danielk1977 Exp $ +# $Id: expr.test,v 1.41 2005/01/11 17:46:42 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. @@ -540,7 +540,11 @@ do_test expr-8.6 { execsql {SELECT CURRENT_TIMESTAMP==datetime('now');} } 1 } set sqlite_current_time 0 + +do_test expr-9.1 { + execsql {SELECT round(-('-'||'123'))} +} 123 finish_test Index: test/interrupt.test ================================================================== --- test/interrupt.test +++ test/interrupt.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is the sqlite_interrupt() API. # -# $Id: interrupt.test,v 1.9 2005/01/11 16:54:15 drh Exp $ +# $Id: interrupt.test,v 1.10 2005/01/11 17:46:42 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl db close @@ -173,7 +173,17 @@ do_test interrupt-4.$i.1 { set ::sqlite_interrupt_count $::i catchsql $sql } {1 interrupted} } + +# Interrupt during parsing +# +do_test interrupt-5.1 { + proc fake_interrupt {args} {sqlite3_interrupt $::DB; return SQLITE_OK} + db collation_needed fake_interrupt + catchsql { + CREATE INDEX fake ON fake1(a COLLATE fake_collation, b, c DESC); + } +} {1 interrupt} finish_test Index: test/main.test ================================================================== --- test/main.test +++ test/main.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is exercising the code in main.c. # -# $Id: main.test,v 1.18 2004/11/04 04:42:28 drh Exp $ +# $Id: main.test,v 1.19 2005/01/11 17:46:42 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Tests of the sqlite_complete() function. @@ -66,11 +66,11 @@ } {1} do_test main-1.14 { db complete {SELECT a-b FROM t1; } } {1} do_test main-1.15 { - db complete {SELECT a-b FROM t1 } + db complete {SELECT a/e FROM t1 } } {0} do_test main-1.16 { db complete { CREATE TABLE abc(x,y); } @@ -177,11 +177,11 @@ } } {0} } do_test main-1.28 { db complete { - CREATE TEMP TRIGGER xyz AFTER DELETE backend BEGIN + CREATE TEMPORARY TRIGGER xyz AFTER DELETE backend BEGIN UPDATE pqr SET a=5; } } {0} do_test main-1.29 { db complete { @@ -275,11 +275,11 @@ catch {db close} foreach f [glob -nocomplain testdb/*] {file delete -force $f} file delete -force testdb sqlite3 db testdb execsql { - create table T1(X REAL); + create table T1(X REAL); /* C-style comments allowed */ insert into T1 values(0.5); insert into T1 values(0.5e2); insert into T1 values(0.5e-002); insert into T1 values(5e-002); insert into T1 values(-5.0e-2);