/ Check-in [7b59930a]
Login

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

Overview
Comment:Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR optimization discovered overnight by OSSFuzz.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7b59930a1d7b664b54d5a2bc9fa385925b5f4c8f34bf401c798307e3e2dae2c6
User & Date: drh 2018-09-22 15:05:32
Context
2018-09-23
02:01
Fix a faulty assert() in the validation logic for the LEFT JOIN strength reduction optimization. Problem found by OSSFuzz. check-in: 2fd62fcc user: drh tags: trunk
2018-09-22
15:05
Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR optimization discovered overnight by OSSFuzz. check-in: 7b59930a user: drh tags: trunk
2018-09-21
23:41
Fix harmless compiler warning when compiled with SQLITE_OMIT_AUTHORIZATION. check-in: 50f2fa19 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2123   2123   static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
  2124   2124     WhereLoop **ppPrev, *p;
  2125   2125     WhereInfo *pWInfo = pBuilder->pWInfo;
  2126   2126     sqlite3 *db = pWInfo->pParse->db;
  2127   2127     int rc;
  2128   2128   
  2129   2129     /* Stop the search once we hit the query planner search limit */
  2130         -  if( pBuilder->iPlanLimit==0 ) return SQLITE_DONE;
         2130  +  if( pBuilder->iPlanLimit==0 ){
         2131  +    WHERETRACE(0xffffffff,("=== query planner search limit reached ===\n"));
         2132  +    if( pBuilder->pOrSet ) pBuilder->pOrSet->n = 0;
         2133  +    return SQLITE_DONE;
         2134  +  }
  2131   2135     pBuilder->iPlanLimit--;
  2132   2136   
  2133   2137     /* If pBuilder->pOrSet is defined, then only keep track of the costs
  2134   2138     ** and prereqs.
  2135   2139     */
  2136   2140     if( pBuilder->pOrSet!=0 ){
  2137   2141       if( pTemplate->nLTerm ){

Changes to test/fuzzdata5.db.

cannot compute difference between binary files