-C Fix\sa\scouple\sof\s(harmless)\sintel\scompiler\swarnings.\s(CVS\s3034)
-D 2006-01-27T06:32:00
+C Fix\sbug\swith\sCHECK\sconstraints\scontain\san\sIN\soperator.\s\sTicket\s#1645.\s(CVS\s3035)
+D 2006-01-30T14:36:59
F Makefile.in e936c6fc3134838318aa0335a85041e6da31f6ee
F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/date.c c70a4f88e495ae2c523f6ef3848c26a021c96de8
F src/delete.c 56ab34c3a384caa5d5ea06f5739944957e2e4213
F src/experimental.c 50c1e3b34f752f4ac10c36f287db095c2b61766d
-F src/expr.c cda707cc5e55394b1597493b8e2456aa18bdaaa0
+F src/expr.c 1149c3380bfce27703f5e9bec7dfb8e51baaf9d9
F src/func.c 96b26601c092b7b43a13e440e3f988b32a385f6a
F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863
F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
F test/format4.test 9f31d41d4f926cab97b2ebe6be00a6ab12dece87
F test/func.test 337888172c054c2de1aa3bacad6115522943dc2c
F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a
-F test/in.test cead6165aebbe0d451bb2263a307173acfeb6240
+F test/in.test 40feeebc7e38576255051aad428322be1545e0f1
F test/index.test c478459611ded74745fee57f99f424da8a5f5fbd
F test/index2.test 9ad98243fd7fe833795a9cc662f371f0eed4ff4f
F test/index3.test f66718cd92ce1216819d47e6a156755e4b2c4ca1
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 7ccebf68eb1f707c2349004ae33575b484cc31a2
-R af3a62a74947b66d5764f2eab77a8c84
-U danielk1977
-Z b88f808b21bcdeecec76ffb8f4e035ac
+P 2e23231f0c10b2bba9e08ea47859e2c0ffa84c76
+R 3b0f9d35458ab8f6669640d2d99a201a
+U drh
+Z da68d113e790373b1b3d356e0a8d22c5
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.252 2006/01/24 12:09:19 danielk1977 Exp $
+** $Id: expr.c,v 1.253 2006/01/30 14:36:59 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
case TK_IN: {
int addr;
char affinity;
+ int ckOffset = pParse->ckOffset;
sqlite3CodeSubselect(pParse, pExpr);
/* Figure out the affinity to use to create a key from the results
affinity = comparisonAffinity(pExpr);
sqlite3VdbeAddOp(v, OP_Integer, 1, 0);
+ pParse->ckOffset = ckOffset+1;
/* Code the <expr> from "<expr> IN (...)". The temporary table
** pExpr->iTable contains the values that make up the (...) set.
# This file implements regression tests for SQLite library. The
# focus of this file is testing the IN and BETWEEN operator.
#
-# $Id: in.test,v 1.14 2005/07/08 18:25:26 drh Exp $
+# $Id: in.test,v 1.15 2006/01/30 14:36:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
}
} {1 {only a single result allowed for a SELECT that is part of an expression}}
+# IN clauses in CHECK constraints. Ticket #1645
+#
+do_test in-10.1 {
+ execsql {
+ CREATE TABLE t5(
+ a INTEGER,
+ CHECK( a IN (111,222,333) )
+ );
+ INSERT INTO t5 VALUES(111);
+ SELECT * FROM t5;
+ }
+} {111}
+do_test in-10.2 {
+ catchsql {
+ INSERT INTO t5 VALUES(4);
+ }
+} {1 {constraint failed}}
+
+
finish_test