mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +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:
@ -47,7 +47,7 @@ do_test unique-1.3 {
|
||||
catchsql {
|
||||
INSERT INTO t1(a,b,c) VALUES(1,3,4)
|
||||
}
|
||||
} {1 {PRIMARY KEY must be unique}}
|
||||
} {1 {UNIQUE constraint failed: t1.a}}
|
||||
verify_ex_errcode unique-1.3b SQLITE_CONSTRAINT_PRIMARYKEY
|
||||
do_test unique-1.4 {
|
||||
execsql {
|
||||
@ -58,7 +58,7 @@ do_test unique-1.5 {
|
||||
catchsql {
|
||||
INSERT INTO t1(a,b,c) VALUES(3,2,4)
|
||||
}
|
||||
} {1 {column b is not unique}}
|
||||
} {1 {UNIQUE constraint failed: t1.b}}
|
||||
verify_ex_errcode unique-1.5b SQLITE_CONSTRAINT_UNIQUE
|
||||
do_test unique-1.6 {
|
||||
execsql {
|
||||
@ -100,7 +100,7 @@ do_test unique-2.3 {
|
||||
catchsql {
|
||||
INSERT INTO t2 VALUES(1,5);
|
||||
}
|
||||
} {1 {column a is not unique}}
|
||||
} {1 {UNIQUE constraint failed: t2.a}}
|
||||
verify_ex_errcode unique-2.3b SQLITE_CONSTRAINT_UNIQUE
|
||||
do_test unique-2.4 {
|
||||
catchsql {
|
||||
@ -127,7 +127,7 @@ do_test unique-2.8 {
|
||||
catchsql {
|
||||
CREATE UNIQUE INDEX i2 ON t2(a);
|
||||
}
|
||||
} {1 {indexed columns are not unique}}
|
||||
} {1 {UNIQUE constraint failed: t2.a}}
|
||||
verify_ex_errcode unique-2.8b SQLITE_CONSTRAINT_UNIQUE
|
||||
do_test unique-2.9 {
|
||||
catchsql {
|
||||
@ -166,7 +166,7 @@ do_test unique-3.4 {
|
||||
INSERT INTO t3(a,b,c,d) VALUES(1,4,3,5);
|
||||
SELECT * FROM t3 ORDER BY a,b,c,d;
|
||||
}
|
||||
} {1 {columns a, c, d are not unique}}
|
||||
} {1 {UNIQUE constraint failed: t3.a, t3.c, t3.d}}
|
||||
verify_ex_errcode unique-3.4b SQLITE_CONSTRAINT_UNIQUE
|
||||
integrity_check unique-3.5
|
||||
|
||||
@ -221,7 +221,7 @@ do_test unique-4.9 {
|
||||
} {0 {}}
|
||||
do_test unique-4.10 {
|
||||
catchsql {CREATE UNIQUE INDEX i4c ON t4(b)}
|
||||
} {1 {indexed columns are not unique}}
|
||||
} {1 {UNIQUE constraint failed: t4.b}}
|
||||
verify_ex_errcode unique-4.10b SQLITE_CONSTRAINT_UNIQUE
|
||||
integrity_check unique-4.99
|
||||
|
||||
@ -254,7 +254,7 @@ do_test unique-5.2 {
|
||||
catchsql {
|
||||
INSERT INTO t5 VALUES(1,2,3,4,5,6);
|
||||
}
|
||||
} {1 {columns first_column_with_long_name, second_column_with_long_name, third_column_with_long_name, fourth_column_with_long_name, fifth_column_with_long_name, sixth_column_with_long_name are not unique}}
|
||||
} {1 {UNIQUE constraint failed: t5.first_column_with_long_name, t5.second_column_with_long_name, t5.third_column_with_long_name, t5.fourth_column_with_long_name, t5.fifth_column_with_long_name, t5.sixth_column_with_long_name}}
|
||||
verify_ex_errcode unique-5.2b SQLITE_CONSTRAINT_UNIQUE
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user