mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Standardize the error messages generated by constraint failures to a format
of "$TYPE constraint failed: $DETAIL". This involves many changes to the expected output of test cases. FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
This commit is contained in:
@ -381,32 +381,32 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (NULL);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.3 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (NULL);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.4 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.5 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.6 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('1234bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.7 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('1234.56bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.8 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (1234);
|
||||
@ -416,7 +416,7 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (1234.56);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.10 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('1234');
|
||||
@ -426,32 +426,32 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('1234.56');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.12 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (ZEROBLOB(4));
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.13 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (X'');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.14 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (X'1234');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.15 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (X'12345678');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.16 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('1234.00');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
do_test func4-3.17 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (1234.00);
|
||||
@ -461,13 +461,13 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES ('-9223372036854775809');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
if {$highPrecision(1)} {
|
||||
do_test func4-3.19 {
|
||||
catchsql {
|
||||
INSERT INTO t1 (x) VALUES (9223372036854775808);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t1}}
|
||||
}
|
||||
do_execsql_test func4-3.20 {
|
||||
SELECT x FROM t1 ORDER BY x;
|
||||
@ -483,32 +483,32 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (NULL);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.3 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (NULL);
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.4 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES ('');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.5 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES ('bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.6 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES ('1234bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.7 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES ('1234.56bad');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.8 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (1234);
|
||||
@ -533,22 +533,22 @@ ifcapable check {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (ZEROBLOB(4));
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.13 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (X'');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.14 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (X'1234');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_test func4-4.15 {
|
||||
catchsql {
|
||||
INSERT INTO t2 (x) VALUES (X'12345678');
|
||||
}
|
||||
} {1 {constraint failed}}
|
||||
} {1 {CHECK constraint failed: t2}}
|
||||
do_execsql_test func4-4.16 {
|
||||
SELECT x FROM t2 ORDER BY x;
|
||||
} {1234.0 1234.0 1234.56 1234.56}
|
||||
|
Reference in New Issue
Block a user