-C Fix\sa\sbug\sin\sthe\sLIKE\squery\soptimization.\s\s(Found\sby\scoverage\stesting.)\s(CVS\s6137)
-D 2009-01-07T18:24:03
+C Add\snew\stest\scases\sto\sincrease\scoverage\sof\swhere.c.\s(CVS\s6138)
+D 2009-01-07T20:58:57
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/vdbemem.c 19f94b504d3da44b31aef200fa6c8e07862de2e8
F src/vtab.c e39e011d7443a8d574b1b9cde207a35522e6df43
F src/walker.c 488c2660e13224ff70c0c82761118efb547f8f0d
-F src/where.c 9852acecfeee1f8650fdec46f20e2368e6c159a0
+F src/where.c 92ef9d964b06ad2f6cba1ee4d19233ac229b2cb3
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 597662c5d777a122f9a3df0047ea5c5bd383a911
F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb
F test/mallocI.test 6e24fe6444bd2999ccc81f984977b44c0d6e5591
F test/mallocJ.test 44dfbbaca731cb933818ad300b4566265d652609
+F test/mallocK.test c2404dc5f33ba1c3d0adffa1d9686a5b0e9b000b
F test/malloc_common.tcl 984baeb6c6b185e798827d1187d426acc2bc4962
F test/manydb.test b3d3bc4c25657e7f68d157f031eb4db7b3df0d3c
F test/memdb.test a67c85a29d3187ac81d3628fcf9417d8a1be9ecb
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P ccc9c211a285fd4da68b69e15594f080371be522
-R 3780da89c170554b5cb3d38edab02288
+P fe90e9116b6e1e25cf3119d2777a8e9c135153ce
+R 8adc87d95beb7782c7b1575af0e0d7a6
U drh
-Z 9ba15e241fcdcbb40439174ae087420f
+Z 3fd090ae0444fbaab790074cb8a7ba0e
-fe90e9116b6e1e25cf3119d2777a8e9c135153ce
\ No newline at end of file
+2e1ab51f05447f9c1f291636b53b1ec584003841
\ No newline at end of file
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.358 2009/01/07 18:24:03 drh Exp $
+** $Id: where.c,v 1.359 2009/01/07 20:58:57 drh Exp $
*/
#include "sqliteInt.h"
whereClauseInit(pAndWC, pWC->pParse, pMaskSet);
whereSplit(pAndWC, pOrTerm->pExpr, TK_AND);
exprAnalyzeAll(pSrc, pAndWC);
+ testcase( db->mallocFailed );
for(j=0, pAndTerm=pAndWC->a; j<pAndWC->nTerm; j++, pAndTerm++){
- if( pAndTerm->pExpr && allowedOp(pAndTerm->pExpr->op) ){
+ assert( pAndTerm->pExpr );
+ if( allowedOp(pAndTerm->pExpr->op) ){
b |= getMask(pMaskSet, pAndTerm->leftCursor);
}
}
--- /dev/null
+# 2008 August 01
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This test script checks malloc failures in WHERE clause analysis.
+#
+# $Id: mallocK.test,v 1.1 2009/01/07 20:58:57 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/malloc_common.tcl
+
+
+set sql {SELECT * FROM t1, t2 WHERE (a=1 OR a=2)}
+for {set x 1} {$x<5} {incr x} {
+ append sql " AND b=y"
+ do_malloc_test mallocK-1.$x -sqlbody $sql -sqlprep {
+ CREATE TABLE t1(a,b);
+ CREATE TABLE t2(x,y);
+ }
+}
+
+set sql {SELECT * FROM t1 WHERE a LIKE 'abc%'}
+for {set x 1} {$x<5} {incr x} {
+ append sql " AND b!=$x"
+ do_malloc_test mallocK-2.$x -sqlbody $sql -sqlprep {
+ CREATE TABLE t1(a,b);
+ }
+}
+
+set sql {SELECT * FROM t1 WHERE a BETWEEN 5 AND 10}
+for {set x 1} {$x<5} {incr x} {
+ append sql " AND b!=$x"
+ do_malloc_test mallocK-3.$x -sqlbody $sql -sqlprep {
+ CREATE TABLE t1(a,b);
+ }
+}
+
+ifcapable vtab {
+ set sql {SELECT * FROM t2 WHERE a MATCH 'xyz'}
+ for {set x 1} {$x<5} {incr x} {
+ append sql " AND b!=$x"
+ do_malloc_test mallocK-4.$x -sqlbody $sql -tclprep {
+ register_echo_module [sqlite3_connection_pointer db]
+ db eval {
+ CREATE TABLE t1(a,b);
+ CREATE VIRTUAL TABLE t2 USING echo(t1);
+ }
+ }
+ }
+}
+
+
+finish_test