mirror of
https://github.com/sqlite/sqlite.git
synced 2026-01-06 08:01:16 +03:00
CLI prescanner made to match SQLite's rules for delimited identifiers. Tests begun.
FossilOrigin-Name: 15b105c520968855ad960d8929f80af9e9bedc155237af9af1956f7b546947f2
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#
|
||||
# shell3-1.*: Basic tests for running SQL statments from command line.
|
||||
# shell3-2.*: Basic tests for running SQL file from command line.
|
||||
# shell3-3.*: Basic tests for processing odd SQL constructs.
|
||||
#
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -26,6 +27,7 @@ db close
|
||||
forcedelete test.db test.db-journal test.db-wal
|
||||
sqlite3 db test.db
|
||||
|
||||
|
||||
# There are inconsistencies in command-line argument quoting on Windows.
|
||||
# In particular, individual applications are responsible for command-line
|
||||
# parsing in Windows, not the shell. Depending on whether the sqlite3.exe
|
||||
@@ -98,4 +100,39 @@ do_test shell3-2.7 {
|
||||
catchcmd "foo.db" "CREATE TABLE"
|
||||
} {1 {Error: near line 1: incomplete input}}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# shell3-3.*: Basic tests for processing odd SQL constructs.
|
||||
#
|
||||
|
||||
# Run combinations of odd identifiers, comments, semicolon placement
|
||||
do_test shell3-3.1 {
|
||||
forcedelete foo.db
|
||||
set rc [ catchcmd "foo.db" {CREATE TABLE t1("
|
||||
a--.
|
||||
" --x
|
||||
); CREATE TABLE t2("a[""b""]");
|
||||
.header on
|
||||
INSERT INTO t1 VALUES ('
|
||||
x''y');
|
||||
INSERT INTO t2 VALUES ('
|
||||
/*.
|
||||
.*/ x
|
||||
''y');
|
||||
SELECT * from t1 limit 1;
|
||||
SELECT * from t2 limit 1;
|
||||
} ]
|
||||
set fexist [file exist foo.db]
|
||||
list $rc $fexist
|
||||
} {{0 {
|
||||
a--.
|
||||
|
||||
|
||||
x'y
|
||||
a["b"]
|
||||
|
||||
/*.
|
||||
.*/ x
|
||||
'y}} 1}
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user