]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove the aOrder() array from where.c. (CVS 824)
authordrh <drh@noemail.net>
Sat, 11 Jan 2003 15:02:44 +0000 (15:02 +0000)
committerdrh <drh@noemail.net>
Sat, 11 Jan 2003 15:02:44 +0000 (15:02 +0000)
FossilOrigin-Name: b2c1edb47f481cafe6718bafcdb517cca160a44d

manifest
manifest.uuid
src/where.c

index 2d3f02a59d19993cb626539a0d8445a095262b55..8bb665adb4080c66d1aea81d10e73b8eda544bef 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-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
@@ -54,7 +54,7 @@ F src/update.c ab3182eae676d7f198354df6a54e8611aac6ae9c
 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
@@ -152,7 +152,7 @@ F www/speed.tcl a20a792738475b68756ea7a19321600f23d1d803
 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
index ddc3fc89d748f2eb6fd6805a83988c7086d14ec1..1e2a39e249ed8a3adee416f56944e68d5feb6318 100644 (file)
@@ -1 +1 @@
-4c22da76ca91f3c59dac1c529e82ac3b04b767bd
\ No newline at end of file
+b2c1edb47f481cafe6718bafcdb517cca160a44d
\ No newline at end of file
index ee7580021c672eba417e89e91c05a1abe631b3eb..b99583c4c04af23449cad8cb8d16ab41e8938185 100644 (file)
@@ -13,7 +13,7 @@
 ** 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"
 
@@ -325,7 +325,6 @@ WhereInfo *sqliteWhereBegin(
   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 */
@@ -355,15 +354,11 @@ WhereInfo *sqliteWhereBegin(
     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;
   }
@@ -406,19 +401,6 @@ WhereInfo *sqliteWhereBegin(
     }
   }
 
-  /* 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
@@ -438,7 +420,7 @@ WhereInfo *sqliteWhereBegin(
   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;
@@ -678,7 +660,7 @@ WhereInfo *sqliteWhereBegin(
   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];
 
@@ -1126,7 +1108,6 @@ WhereInfo *sqliteWhereBegin(
   if( pushKey && !haveKey ){
     sqliteVdbeAddOp(v, OP_Recno, base, 0);
   }
-  sqliteFree(aOrder);
   return pWInfo;
 }