1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

If a CHECK constraint is named, report that name on the error message when

the constraint fails.

FossilOrigin-Name: 9a0f90d9deb335ac71044b8afa81538d85cc7ccf
This commit is contained in:
drh
2012-03-07 19:13:29 +00:00
parent fd6ddf91b0
commit 2938f924cc
7 changed files with 65 additions and 42 deletions

View File

@@ -1274,7 +1274,7 @@ struct Table {
FKey *pFKey; /* Linked list of all foreign keys in this table */
char *zColAff; /* String defining the affinity of each column */
#ifndef SQLITE_OMIT_CHECK
Expr *pCheck; /* The AND of all CHECK constraints */
ExprList *pCheck; /* All CHECK constraints */
#endif
#ifndef SQLITE_OMIT_ALTERTABLE
int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */
@@ -2208,6 +2208,7 @@ struct Parse {
int regRowid; /* Register holding rowid of CREATE TABLE entry */
int regRoot; /* Register holding root page number for new objects */
int nMaxArg; /* Max args passed to user function by sub-program */
Token constraintName;/* Name of the constraint currently being parsed */
#ifndef SQLITE_OMIT_SHARED_CACHE
int nTableLock; /* Number of locks in aTableLock */
TableLock *aTableLock; /* Required table locks for shared-cache mode */