mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Make sure pParse->rc gets set whenever sqlite3ErrorMsg() is called. This is
added insurance that parsing will stop quickly after an error. This change did make the parser stop faster in some cases, which required some revisions to tests. (CVS 4010) FossilOrigin-Name: f84d9dab110c4415d9b772f8043397640162b6b2
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is testing the ALTER TABLE statement.
|
||||
#
|
||||
# $Id: alter.test,v 1.24 2007/05/15 14:34:32 drh Exp $
|
||||
# $Id: alter.test,v 1.25 2007/05/15 16:51:37 drh Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@ -702,10 +702,13 @@ do_test alter-11.1 {
|
||||
ALTER TABLE t11 ADD COLUMN abc;
|
||||
}
|
||||
} {1 {duplicate column name: abc}}
|
||||
do_test alter-11.2 {
|
||||
execsql {INSERT INTO t11 VALUES(1,2)}
|
||||
sqlite3_exec db {SELECT %c6%c6 AS xyz, abc FROM t11}
|
||||
} {0 {xyz abc 1 2}}
|
||||
set isutf16 [regexp 16 [db one {PRAGMA encoding}]]
|
||||
if {!$isutf16} {
|
||||
do_test alter-11.2 {
|
||||
execsql {INSERT INTO t11 VALUES(1,2)}
|
||||
sqlite3_exec db {SELECT %c6%c6 AS xyz, abc FROM t11}
|
||||
} {0 {xyz abc 1 2}}
|
||||
}
|
||||
do_test alter-11.3 {
|
||||
sqlite3_exec db {CREATE TABLE t11b("%81%82%83" text)}
|
||||
execsql {
|
||||
@ -715,16 +718,18 @@ do_test alter-11.3 {
|
||||
ALTER TABLE t11b ADD COLUMN abc;
|
||||
}
|
||||
} {1 {duplicate column name: abc}}
|
||||
do_test alter-11.4 {
|
||||
execsql {INSERT INTO t11b VALUES(3,4)}
|
||||
sqlite3_exec db {SELECT %81%82%83 AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
do_test alter-11.5 {
|
||||
sqlite3_exec db {SELECT [%81%82%83] AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
do_test alter-11.6 {
|
||||
sqlite3_exec db {SELECT "%81%82%83" AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
if {!$isutf16} {
|
||||
do_test alter-11.4 {
|
||||
execsql {INSERT INTO t11b VALUES(3,4)}
|
||||
sqlite3_exec db {SELECT %81%82%83 AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
do_test alter-11.5 {
|
||||
sqlite3_exec db {SELECT [%81%82%83] AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
do_test alter-11.6 {
|
||||
sqlite3_exec db {SELECT "%81%82%83" AS xyz, abc FROM t11b}
|
||||
} {0 {xyz abc 3 4}}
|
||||
}
|
||||
do_test alter-11.7 {
|
||||
sqlite3_exec db {CREATE TABLE t11c(%81%82%83 text)}
|
||||
execsql {
|
||||
@ -734,16 +739,18 @@ do_test alter-11.7 {
|
||||
ALTER TABLE t11c ADD COLUMN abc;
|
||||
}
|
||||
} {1 {duplicate column name: abc}}
|
||||
do_test alter-11.8 {
|
||||
execsql {INSERT INTO t11c VALUES(5,6)}
|
||||
sqlite3_exec db {SELECT %81%82%83 AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
do_test alter-11.9 {
|
||||
sqlite3_exec db {SELECT [%81%82%83] AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
do_test alter-11.10 {
|
||||
sqlite3_exec db {SELECT "%81%82%83" AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
if {!$isutf16} {
|
||||
do_test alter-11.8 {
|
||||
execsql {INSERT INTO t11c VALUES(5,6)}
|
||||
sqlite3_exec db {SELECT %81%82%83 AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
do_test alter-11.9 {
|
||||
sqlite3_exec db {SELECT [%81%82%83] AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
do_test alter-11.10 {
|
||||
sqlite3_exec db {SELECT "%81%82%83" AS xyz, abc FROM t11c}
|
||||
} {0 {xyz abc 5 6}}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user