]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
CHECK constraints that evaluate to NULL pass. (CVS 2755)
authordrh <drh@noemail.net>
Thu, 3 Nov 2005 01:22:30 +0000 (01:22 +0000)
committerdrh <drh@noemail.net>
Thu, 3 Nov 2005 01:22:30 +0000 (01:22 +0000)
FossilOrigin-Name: 55b314a22c69fbe129b024e953f3230b67eaaa87

manifest
manifest.uuid
src/insert.c
test/check.test

index 8e0c1d60f988d3e5c7d293522106399df9e5ba60..337655fb0970d924d76fc46b927ba16a5d9657f8 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C First\scut\sat\ssupporting\sCHECK\sconstraints.\s\sEverything\sappears\sto\swork,\nbut\smuch\smore\stesting\sis\sneeded\sas\swell\sas\sdocumentation.\s(CVS\s2754)
-D 2005-11-03T00:41:17
+C CHECK\sconstraints\sthat\sevaluate\sto\sNULL\spass.\s(CVS\s2755)
+D 2005-11-03T01:22:31
 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1
 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -45,7 +45,7 @@ F src/expr.c e74e9c265c3572f71ab9d8f795cb656469209bb6
 F src/func.c 7d81dccd9c440c6c4e761056333e629192814af0
 F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863
 F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
-F src/insert.c b814e8d73b725cf34ff9328573ea052226c290bd
+F src/insert.c c8f12b468f311f55ecfadda2fe08799bf2633a18
 F src/legacy.c d58ea507bce885298a2c8c3cbb0f4bff5d47830b
 F src/main.c 97bb830cdbd378d1f87469618471f52d9d263d09
 F src/md5.c 7ae1c39044b95de2f62e066f47bb1deb880a1070
@@ -124,7 +124,7 @@ F test/capi2.test f897209386fb21cfdc9267595e0c667ebaca9164
 F test/capi3.test fc8e573467049add3bfaf81f53827e8ff153cf8f
 F test/capi3b.test 5b6a66f9f295f79f443b5d3f33187fa5ef6cf336
 F test/cast.test 2543165ced4249c89ce5f0352222df503a98b9e5
-F test/check.test 073a4b542793e4acb7bcfa2abb838586a3462625
+F test/check.test d7f0850650b7c0adda71cbc99eba4407475a9424
 F test/collate1.test add9454cef160677bb8b34148b8f277ce7f9f1c4
 F test/collate2.test 224a632ba04907c049804b08162efd234aa7871f
 F test/collate3.test 947a77f5b8227e037a7094d0e338a5504f155cc4
@@ -316,7 +316,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P e0d6f61c7de2c03b8fd17ef37cf1a0add36ee618
-R 1ff7e911d1dc61bef39e78e87be5de02
+P 2313d912baeca0fd516d524f16708953de483729
+R d64542a6a946813b7fd22cace2c7e954
 U drh
-Z c4af40f7e2f1f1ea9a28a66e94a942b3
+Z 1f3c50f7b443762a810db649999a6322
index f9f5b3ad09b85c9a277ea13905464336d021d238..042662170b0501b27b84b369d03dbd872fd49190 100644 (file)
@@ -1 +1 @@
-2313d912baeca0fd516d524f16708953de483729
\ No newline at end of file
+55b314a22c69fbe129b024e953f3230b67eaaa87
\ No newline at end of file
index f4122435cb7c9dbd7d981c1b33a3793bdc9e94cc..33090b18e3053655a2672f5469b0311c5f47250c 100644 (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);
index 392531f95ce045e09f061735a89e26a94e61afc3..83d92367716b0188797fc46bdcaa8e12e703192b 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing CHECK constraints
 #
-# $Id: check.test,v 1.1 2005/11/03 00:41:18 drh Exp $
+# $Id: check.test,v 1.2 2005/11/03 01:22:31 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -60,24 +60,25 @@ do_test check-1.7 {
   catchsql {
     INSERT INTO t1 VALUES(NULL,6);
   }
-} {1 {constraint failed}}
+} {0 {}}
 do_test check-1.8 {
   execsql {
     SELECT * FROM t1;
   }  
-} {3 4}
+} {3 4 {} 6}
 do_test check-1.9 {
   catchsql {
     INSERT INTO t1 VALUES(2,NULL);
   }
-} {1 {constraint failed}}
+} {0 {}}
 do_test check-1.10 {
   execsql {
     SELECT * FROM t1;
   }  
-} {3 4}
+} {3 4 {} 6 2 {}}
 do_test check-1.11 {
   execsql {
+    DELETE FROM t1 WHERE x IS NULL OR x!=3;
     UPDATE t1 SET x=2 WHERE x==3;
     SELECT * FROM t1;
   }