/ Check-in [633b214e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix another potential "jump depends on uninitialized value" warning.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 633b214e9b9d99788ed72ab4823a69a43c7c40ed07fb76c7d56c50453c0e58ab
User & Date: drh 2019-09-18 12:49:34
Context
2019-09-18
17:22
Add extra tests for the handling of corrupt records in fts3. check-in: 40e29a47 user: dan tags: trunk
12:49
Fix another potential "jump depends on uninitialized value" warning. check-in: 633b214e user: drh tags: trunk
11:46
Fix a "jump depends on unititialized value" valgrind error in fts5 triggered by corrupt database records. check-in: 6b6751cd user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2264   2264   static void whereLoopOutputAdjust(
  2265   2265     WhereClause *pWC,      /* The WHERE clause */
  2266   2266     WhereLoop *pLoop,      /* The loop to adjust downward */
  2267   2267     LogEst nRow            /* Number of rows in the entire table */
  2268   2268   ){
  2269   2269     WhereTerm *pTerm, *pX;
  2270   2270     Bitmask notAllowed = ~(pLoop->prereq|pLoop->maskSelf);
  2271         -  int i, j, k;
         2271  +  int i, j;
  2272   2272     LogEst iReduce = 0;    /* pLoop->nOut should not exceed nRow-iReduce */
  2273   2273   
  2274   2274     assert( (pLoop->wsFlags & WHERE_AUTO_INDEX)==0 );
  2275   2275     for(i=pWC->nTerm, pTerm=pWC->a; i>0; i--, pTerm++){
  2276   2276       assert( pTerm!=0 );
  2277   2277       if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) break;
  2278   2278       if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue;
................................................................................
  2290   2290           pLoop->nOut += pTerm->truthProb;
  2291   2291         }else{
  2292   2292           /* In the absence of explicit truth probabilities, use heuristics to
  2293   2293           ** guess a reasonable truth probability. */
  2294   2294           pLoop->nOut--;
  2295   2295           if( pTerm->eOperator&(WO_EQ|WO_IS) ){
  2296   2296             Expr *pRight = pTerm->pExpr->pRight;
         2297  +          int k = 0;
  2297   2298             testcase( pTerm->pExpr->op==TK_IS );
  2298   2299             if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){
  2299   2300               k = 10;
  2300   2301             }else{
  2301   2302               k = 20;
  2302   2303             }
  2303   2304             if( iReduce<k ) iReduce = k;