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

CHECK constraints that evaluate to NULL pass. (CVS 2755)

FossilOrigin-Name: 55b314a22c69fbe129b024e953f3230b67eaaa87
This commit is contained in:
drh
2005-11-03 01:22:30 +00:00
parent ffe07b2dc1
commit 6275b88b9e
4 changed files with 16 additions and 15 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
** $Id: insert.c,v 1.145 2005/11/03 00:41:17 drh Exp $
** $Id: insert.c,v 1.146 2005/11/03 01:22:31 drh Exp $
*/
#include "sqliteInt.h"
@@ -873,7 +873,7 @@ void sqlite3GenerateConstraintChecks(
int allOk = sqlite3VdbeMakeLabel(v);
assert( pParse->ckOffset==0 );
pParse->ckOffset = nCol;
sqlite3ExprIfTrue(pParse, pTab->pCheck, allOk, 0);
sqlite3ExprIfTrue(pParse, pTab->pCheck, allOk, 1);
assert( pParse->ckOffset==nCol );
pParse->ckOffset = 0;
sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort);