]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the computation of the number of rows in a table during automatic
authordrh <drh@noemail.net>
Thu, 8 Apr 2010 15:00:59 +0000 (15:00 +0000)
committerdrh <drh@noemail.net>
Thu, 8 Apr 2010 15:00:59 +0000 (15:00 +0000)
index generation.

FossilOrigin-Name: edeab06a5010c82491a6cc9393cf2a35a7622ac5

manifest
manifest.uuid
src/where.c

index 2cfccb019f710ab014a13b44e4f343242e846b0f..1082fd5ef6237bab8586577fd8f54380462a3abd 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Fix\san\sinteger\soverflow\sbug\sin\sthe\sautomatic\sindex\slogic.\s\sThe\sbug\swas\ndetected\sby\sthe\stestcase()\smacros\sadded\sin\sthe\sprevious\scheck-in.\s\sAlso\nadd\ssome\smore\stestcase()\smacros,\ssince\sthis\sissue\spoints\sup\stheir\simportance.
-D 2010-04-08T14:38:52
+C Fix\sthe\scomputation\sof\sthe\snumber\sof\srows\sin\sa\stable\sduring\sautomatic\nindex\sgeneration.
+D 2010-04-08T15:01:00
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -225,7 +225,7 @@ F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1
 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2
 F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda
 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
-F src/where.c 15a4eef6bce7cf1bbf482c9e17b108d0b7a92a82
+F src/where.c 93621d17d920f88eddd1128c9d24a580d3d3186e
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
 F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45
@@ -799,14 +799,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 7286547847721b8f5f64bc2e7dc236652b1ae985
-R 96a8069556b5a410b2e431cd978a7df7
+P af97b4881a8f010055cde672634141d7ed6898fc
+R 189f525b453ffe6645c72e74e5753384
 U drh
-Z d04d44898ea5b97de880f4d4839621a4
+Z 120eeaf33e13295b22c77bafcc4479fd
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFLveqAoxKgR168RlERAg5iAJ9bvCC1ncZeGw9njwB9ke6HucmE9gCePKdl
-9wmrvenH+dOO2hKdhlCA+O0=
-=pW+N
+iD8DBQFLve+voxKgR168RlERAu90AJ9LihyzApsQCmIA/Se27rrzZ3urCgCfZ9Ei
+GvxJaneZawJ1mUfT4w2pFAE=
+=6WQF
 -----END PGP SIGNATURE-----
index 259efecd4966b44efdd0ea8989ae1319e6c58e1e..2024eafaaa14c2c8db9e168d0ed5f5af8a2486af 100644 (file)
@@ -1 +1 @@
-af97b4881a8f010055cde672634141d7ed6898fc
\ No newline at end of file
+edeab06a5010c82491a6cc9393cf2a35a7622ac5
\ No newline at end of file
index a90f8c740d518495a0f2fe517903f8c5138b574c..dbb1f3f395c95de6f53c8ea361c7eb60b2f736b2 100644 (file)
@@ -1695,7 +1695,8 @@ static void bestAutomaticIndex(
   }
 
   assert( pParse->nQueryLoop >= (double)1 );
-  nTableRow = pSrc->pIndex ? pSrc->pIndex->aiRowEst[0] : 1000000;
+  pTable = pSrc->pTab;
+  nTableRow = pTable->pIndex ? pTable->pIndex->aiRowEst[0] : 1000000;
   logN = estLog(nTableRow);
   costTempIdx = 2*logN*(nTableRow/pParse->nQueryLoop + 1);
   if( costTempIdx>=pCost->rCost ){
@@ -1705,7 +1706,6 @@ static void bestAutomaticIndex(
   }
 
   /* Search for any equality comparison term */
-  pTable = pSrc->pTab;
   pWCEnd = &pWC->a[pWC->nTerm];
   for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
     if( termCanDriveIndex(pTerm, pSrc, notReady) ){