-C Adjustments\sto\stestcase()\smacros\sfor\simproved\stestability.
-D 2013-06-18T20:06:23.048
+C Fix\scompiler\swarnings.\s\sFix\sa\sharmless\soff-by-one\serror\sin\sthe\ssolver.
+D 2013-06-19T03:27:12.614
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222
F src/pcache1.c d23d07716de96c7c0c2503ec5051a4384c3fb938
F src/pragma.c 67a611bd4be0754f27ee13eb87932c3b14415862
-F src/prepare.c 213de4aae5e29cfbb32202d1c09f4fc4b5a51b09
+F src/prepare.c 2306be166bbeddf454e18bf8b21dba8388d05328
F src/printf.c bff529ed47657098c55c9910b9c69b1b3b1a1353
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c 89f9003e8316ee3a172795459efc2a0274e1d5a8
F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c 85b7b80a350951444c8e3e45bf2f7e6cc6d34683
+F src/where.c 5cc059bd283fe9f99800270c797fabdcbef8009a
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 4c6d58d75d51e1ce829aec214617c3a89e784a2d
-R f77d52adfdd29eb20a93333ac0fbc3fa
+P 4fbb0c4d26c54aaefbe5397cde2a0b9d2ce3885f
+R dae7f42197a8d862e7c14dd3769614f8
U drh
-Z e0df54c8e9d824f28c0e34a1e5fe6134
+Z e26ab5beb4ba36d99e52a8a301bdec10
-4fbb0c4d26c54aaefbe5397cde2a0b9d2ce3885f
\ No newline at end of file
+10021941d0258951b916e788881df140113f0597
\ No newline at end of file
sqlite3VtabUnlockList(db);
pParse->db = db;
- pParse->nQueryLoop = 1;
+ pParse->nQueryLoop = 0; /* Logarithmic, so 0 really means 1 */
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
char *zSqlCopy;
int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
}else{
sqlite3RunParser(pParse, zSql, &zErrMsg);
}
- assert( 1==pParse->nQueryLoop );
+ assert( 0==pParse->nQueryLoop );
if( db->mallocFailed ){
pParse->rc = SQLITE_NOMEM;
int rc = SQLITE_OK; /* Return code */
WhereCost nRowEst; /* Estimated index selectivity */
WhereCost rLogSize; /* Logarithm of table size */
- WhereTerm *pTop, *pBtm; /* Top and bottom range constraints */
+ WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */
pNew = pBuilder->pNew;
if( db->mallocFailed ) return SQLITE_NOMEM;
if( pNew->u.btree.nEq < pProbe->nColumn ){
iCol = pProbe->aiColumn[pNew->u.btree.nEq];
nRowEst = whereCost(pProbe->aiRowEst[pNew->u.btree.nEq+1]);
+ if( nRowEst==0 && pProbe->onError==OE_None ) nRowEst = 1;
}else{
iCol = -1;
nRowEst = 0;
sSubBuild.pOrderBy = 0;
sSubBuild.pBest = &sBest;
- for(pOrTerm=pOrWC->a; rc==SQLITE_OK && pOrTerm<pOrWCEnd; pOrTerm++){
+ for(pOrTerm=pOrWC->a; pOrTerm<pOrWCEnd; pOrTerm++){
if( (pOrTerm->eOperator & WO_AND)!=0 ){
sSubBuild.pWC = &pOrTerm->u.pAndInfo->wc;
}else if( pOrTerm->leftCursor==iCur ){
{
rc = whereLoopAddBtree(&sSubBuild, mExtra);
}
+ /* sBest.maskSelf is always zero if an error occurs */
+ assert( rc==SQLITE_OK || sBest.maskSelf==0 );
if( sBest.maskSelf==0 ) break;
assert( sBest.rSetup==0 );
rTotal = whereCostAdd(rTotal, sBest.rRun);
** attempts to find the lowest cost path that visits each WhereLoop
** once. This path is then loaded into the pWInfo->a[].pWLoop fields.
**
+** Assume that the total number of output rows that will need to be sorted
+** will be nRowEst (in the 10*log2 representation). Or, ignore sorting
+** costs if nRowEst==0.
+**
** Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
** error occurs.
*/
int iLoop; /* Loop counter over the terms of the join */
int ii, jj; /* Loop counters */
WhereCost rCost; /* Cost of a path */
- WhereCost mxCost; /* Maximum cost of a set of paths */
+ WhereCost mxCost = 0; /* Maximum cost of a set of paths */
WhereCost rSortCost; /* Cost to do a sort */
int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */
WherePath *aFrom; /* All nFrom paths at the previous level */
wherePathSolver(pWInfo, 0);
if( db->mallocFailed ) goto whereBeginError;
if( pWInfo->pOrderBy ){
- wherePathSolver(pWInfo, pWInfo->nRowOut);
+ wherePathSolver(pWInfo, pWInfo->nRowOut+1);
if( db->mallocFailed ) goto whereBeginError;
}
}