/ Check-in [71b6c260]
Login

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

Overview
Comment:Fix a potential NULL-pointer dereference following an OOM error in the query planner logic for virtual tables with OR-connected terms.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | IN-with-ORDERBY
Files: files | file ages | folders
SHA1: 71b6c26053fdf2a5a84116e005bad1f2ca873a66
User & Date: drh 2013-02-08 23:18:18
Context
2013-02-13
01:00
Allow an index to be used for sorting even if prior terms of the index are constrained by IN operators. check-in: 2cef8b68 user: drh tags: trunk
2013-02-08
23:18
Fix a potential NULL-pointer dereference following an OOM error in the query planner logic for virtual tables with OR-connected terms. Closed-Leaf check-in: 71b6c260 user: drh tags: IN-with-ORDERBY
20:39
Make sure the virtual tables that take advantage of IN operators sort the RHS of the IN operator in the correct order according to the ORDER BY clause. check-in: b016b754 user: drh tags: IN-with-ORDERBY
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3661   3661   */
  3662   3662   static void bestIndex(WhereBestIdx *p){
  3663   3663   #ifndef SQLITE_OMIT_VIRTUALTABLE
  3664   3664     if( IsVirtual(p->pSrc->pTab) ){
  3665   3665       sqlite3_index_info *pIdxInfo = 0;
  3666   3666       p->ppIdxInfo = &pIdxInfo;
  3667   3667       bestVirtualIndex(p);
  3668         -    if( pIdxInfo->needToFreeIdxStr ){
         3668  +    assert( pIdxInfo!=0 || p->pParse->db->mallocFailed );
         3669  +    if( pIdxInfo && pIdxInfo->needToFreeIdxStr ){
  3669   3670         sqlite3_free(pIdxInfo->idxStr);
  3670   3671       }
  3671   3672       sqlite3DbFree(p->pParse->db, pIdxInfo);
  3672   3673     }else
  3673   3674   #endif
  3674   3675     {
  3675   3676       bestBtreeIndex(p);