-C Fix\sa\sbug\sin\sREADME.tokenizers.\sTicket\s#3559.\s(CVS\s6075)
-D 2008-12-30T06:36:51
+C Fix\sa\sbug\sin\swhere.c\scausing\sa\smalfunction\swhen\san\sINDEXED\sBY\sclause\sspecified\san\sunusable\sindex\son\sother\sthan\sthe\sleftmost\stable\sin\sthe\sFROM\sclause.\sTicket\s#3560.\s(CVS\s6076)
+D 2008-12-30T09:45:46
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 77635d0909c2067cee03889a1e04ce910d8fb809
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/vdbemem.c f9c859ac17e2e05a0f249868ce4f191f69edd31d
F src/vtab.c e39e011d7443a8d574b1b9cde207a35522e6df43
F src/walker.c 488c2660e13224ff70c0c82761118efb547f8f0d
-F src/where.c d0f422dd1a72a59484af77433412af53da63c78a
+F src/where.c 1e1cadcfda4c2606c23c03844268d4b90f5f048d
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 597662c5d777a122f9a3df0047ea5c5bd383a911
F test/index.test cbf301cdb2da43e4eac636c3400c2439af1834ad
F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6
F test/index3.test 727d55dceb9a4ec36675057bb5becfc265e28ca6
-F test/indexedby.test 03af52375e50d146e78f56442b6677d2932c4963
+F test/indexedby.test bcf239ccdc5ac6112110136f8481b40dcd070164
F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908
F test/insert2.test 4f3a04d168c728ed5ec2c88842e772606c7ce435
F test/insert3.test 7188f1da1126eb15f1b27cf34f4c2753c7d5fd27
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P e49807b16f7f86d3f2290d6c1f7562f3db6330f9
-R 45eb8d1c87cec4e4583352d46a05ae31
+P b8898d132e84888dc7c51b2f1ab67f78cc21f31b
+R b7839f0e2e3e66238c8ec07900a2d5d4
U danielk1977
-Z 92973555b0dc8dd6b677002c21a4cbbb
+Z 3f55cc2a8dd0beb6d8e0657bdc1d6da5
-b8898d132e84888dc7c51b2f1ab67f78cc21f31b
\ No newline at end of file
+f8ff0212129ce602a1e1e9ad702c47b9302f2f21
\ 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.350 2008/12/29 23:45:07 drh Exp $
+** $Id: where.c,v 1.351 2008/12/30 09:45:46 danielk1977 Exp $
*/
#include "sqliteInt.h"
bestIndex(pParse, pWC, pTabItem, notReady,
(i==0 && ppOrderBy) ? *ppOrderBy : 0, &sCost);
}
- if( sCost.rCost<bestPlan.rCost ){
+ if( once==0 || sCost.rCost<bestPlan.rCost ){
once = 1;
bestPlan = sCost;
bestJ = j;
}
if( doNotReorder ) break;
}
+ assert( once );
+ assert( notReady & getMask(pMaskSet, pTabList->a[bestJ].iCursor) );
WHERETRACE(("*** Optimizer selects table %d for loop %d\n", bestJ,
pLevel-pWInfo->a));
if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){
#
#***********************************************************************
#
-# $Id: indexedby.test,v 1.3 2008/10/06 16:18:40 danielk1977 Exp $
+# $Id: indexedby.test,v 1.4 2008/12/30 09:45:46 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
catchsql { UPDATE t1 INDEXED BY i2 SET rowid=rowid+1 WHERE a = 5}
} {1 {cannot use index: i2}}
+# Test that bug #3560 is fixed.
+#
+do_test indexedby-9.1 {
+ execsql {
+ CREATE TABLE maintable( id integer);
+ CREATE TABLE joinme(id_int integer, id_text text);
+ CREATE INDEX joinme_id_text_idx on joinme(id_text);
+ CREATE INDEX joinme_id_int_idx on joinme(id_int);
+ }
+} {}
+do_test indexedby-9.2 {
+ catchsql {
+ select * from maintable as m inner join
+ joinme as j indexed by joinme_id_text_idx
+ on ( m.id = j.id_int)
+ }
+} {1 {cannot use index: joinme_id_text_idx}}
+do_test indexedby-9.3 {
+ catchsql { select * from maintable, joinme INDEXED by joinme_id_text_idx }
+} {1 {cannot use index: joinme_id_text_idx}}
+
finish_test