-C Fix\stwo\scompiler\swarnings\sfrom\sOS-X.\s(CVS\s823)
-D 2003-01-11T14:25:40
+C Remove\sthe\saOrder()\sarray\sfrom\swhere.c.\s(CVS\s824)
+D 2003-01-11T15:02:45
F Makefile.in 868c17a1ae1c07603d491274cc8f86c04acf2a1e
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/util.c e2d108842e02810d3d3242cac0e024b09cdb3c4a
F src/vdbe.c e1f66bb2f56bf3cd974d5a385bfd03ace5c108a5
F src/vdbe.h 754eba497cfe0c3e352b9c101ab2f811f10d0a55
-F src/where.c 8cbdba90cdcf61d448e9115135a2c49e5bc71648
+F src/where.c 5bf7f1e1d756ab3d25a18b24bb42106cb8e14d18
F test/all.test 873d30e25a41b3aa48fec5633a7ec1816e107029
F test/bigfile.test 1cd8256d4619c39bea48147d344f348823e78678
F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P e84d3afe7b9153d003fdcca98221f446c004ffa2
-R 88c74dbafc42cc36f311514cad54068d
+P 4c22da76ca91f3c59dac1c529e82ac3b04b767bd
+R 4a2b6f4541d31472e460c1ba1de18bd4
U drh
-Z 9a29d224db25224da4d0f0c850682af0
+Z a470dc03da337ece1ad70e48af485f54
** the WHERE clause of SQL statements. Also found here are subroutines
** to generate VDBE code to evaluate expressions.
**
-** $Id: where.c,v 1.70 2003/01/11 14:25:40 drh Exp $
+** $Id: where.c,v 1.71 2003/01/11 15:02:45 drh Exp $
*/
#include "sqliteInt.h"
WhereInfo *pWInfo; /* Will become the return value of this function */
Vdbe *v = pParse->pVdbe; /* The virtual database engine */
int brk, cont; /* Addresses used during code generation */
- int *aOrder; /* Order in which pTabList entries are searched */
int nExpr; /* Number of subexpressions in the WHERE clause */
int loopMask; /* One bit set for each outer loop */
int haveKey; /* True if KEY is on the stack */
return 0;
}
- /* Allocate space for aOrder[] */
- aOrder = sqliteMalloc( sizeof(int) * pTabList->nSrc );
-
/* Allocate and initialize the WhereInfo structure that will become the
** return value.
*/
pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel));
if( sqlite_malloc_failed ){
- sqliteFree(aOrder);
sqliteFree(pWInfo);
return 0;
}
}
}
- /* Figure out a good nesting order for the tables. aOrder[0] will
- ** be the index in pTabList of the outermost table. aOrder[1] will
- ** be the first nested loop and so on. aOrder[pTabList->nSrc-1] will
- ** be the innermost loop.
- **
- ** Someday we will put in a good algorithm here to reorder the loops
- ** for an effiecient query. But for now, just use whatever order the
- ** tables appear in in the pTabList.
- */
- for(i=0; i<pTabList->nSrc; i++){
- aOrder[i] = i;
- }
-
/* Figure out what index to use (if any) for each nested loop.
** Make pWInfo->a[i].pIdx point to the index to use for the i-th nested
** loop where i==0 is the outer loop and i==pTabList->nSrc-1 is the inner
loopMask = 0;
for(i=0; i<pTabList->nSrc && i<ARRAYSIZE(iDirectEq); i++){
int j;
- int idx = aOrder[i];
+ int idx = i;
Table *pTab = pTabList->a[idx].pTab;
Index *pIdx;
Index *pBestIdx = 0;
loopMask = 0;
for(i=0; i<pTabList->nSrc; i++){
int j, k;
- int idx = aOrder[i];
+ int idx = i;
Index *pIdx;
WhereLevel *pLevel = &pWInfo->a[i];
if( pushKey && !haveKey ){
sqliteVdbeAddOp(v, OP_Recno, base, 0);
}
- sqliteFree(aOrder);
return pWInfo;
}