On Sun, Oct 21, 2012 at 12:21 PM, Sean Doull-Connolly <sea...@att.net>wrote:

> SQLite version 3.7.11
> Fedora 17
> Linux 3.3.4-5.fc17.i686.PAE
>
> The CREATE TABLE text file below is missing a comma after the first
> FOREIGN KEY
> clause, and this should draw an error.
> No error is reported, and the table is created with all three FOREIGN KEY
> constraints.
>

This is not something we are at liberty to change.

The complete text of CREATE TABLE statements is stored in the sqlite_master
table and reparsed every time the database is opened, so that the new
database connection can know the schema.  There are hundreds of thousands,
perhaps millions, of individual applications in circulation that use
SQLite.  Some percentage of those might have missing commas in their
FOREIGN KEY statements.  If we change SQLite to enforce the comma, those
applications would break.


>
> $ sqlite3 test.db <test.sql
>
> ==== test.sql =================
>
> CREATE TABLE  path2file (
>     id        INTEGER NOT NULL PRIMARY KEY,
>     f_id      INTEGER,
>     p_id      INTEGER,
>     z_id      INTEGER,
>     mode      CHAR(4),
>     date_stmp CHAR(10),
>     time_stmp CHAR(10),
>     FOREIGN KEY (f_id) REFERENCES file (id)
>     FOREIGN KEY (p_id) REFERENCES path (id),
>     FOREIGN KEY (z_id) REFERENCES backup_zip (id)
>     );
>
>  ===========================
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to