1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Parser bug fix: Make sure the table constraints allowed by prior releases

can still be parsed, even if they are technically not allowed by the
syntax diagram.

FossilOrigin-Name: e536ac041815b118c461ceee798f9b7283269f58
This commit is contained in:
drh
2012-05-12 18:29:53 +00:00
parent 64b95bbcdc
commit ab35eaed1f
4 changed files with 32 additions and 15 deletions

View File

@ -45,6 +45,23 @@ do_test schema5-1.3 {
do_test schema5-1.4 {
catchsql {INSERT INTO t1 VALUES(10,11,12);}
} {1 {constraint two failed}}
do_test schema5-1.5 {
db eval {
DROP TABLE t1;
CREATE TABLE t1(a,b,c,
UNIQUE(a) CONSTRAINT one,
PRIMARY KEY(b,c) CONSTRAINT two
);
INSERT INTO t1 VALUES(1,2,3);
}
} {}
do_test schema5-1.6 {
catchsql {INSERT INTO t1 VALUES(1,3,4)}
} {1 {column a is not unique}}
do_test schema5-1.7 {
catchsql {INSERT INTO t1 VALUES(10,2,3)}
} {1 {columns b, c are not unique}}