[sqlite] Shell .dump incorrectly quotes the table name in 3.7.11

5 views
Skip to first unread message

Martin

unread,
Mar 21, 2012, 8:31:03 AM3/21/12
to sqlite...@sqlite.org
Shell .dump command produces incorrect output when using keyword as a
table name.

Example:

SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE "table" ("column" TEXT);
sqlite> INSERT INTO "table" VALUES('value');
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "table" ("column" TEXT);
INSERT INTO table VALUES('value');
COMMIT;

Reading this dump will cause a syntax error:

sqlite> .read dump.sql
Error: near line 4: near "table": syntax error

The table name in the insert statement is not properly quoted.
I think that this behavior is related to the change (3) at
http://www.sqlite.org/src/info/e6eea8d50d

Thanks

Martin
_______________________________________________
sqlite-users mailing list
sqlite...@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply all
Reply to author
Forward
0 new messages