/ Check-in [127b1398]
Login

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

Overview
Comment:Make sure the result of sqlite3VdbeGetOp() is not used as an array following an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:127b13981960a9690de09e8f9d0b38a4bd76015f
User & Date: drh 2009-06-06 15:17:28
Context
2009-06-06
16:08
Fix an error in the malloc.test test script causing a small buffer overread. (CVS 6725) check-in: 4d129bee user: danielk1977 tags: trunk
15:17
Make sure the result of sqlite3VdbeGetOp() is not used as an array following an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724) check-in: 127b1398 user: drh tags: trunk
14:13
When building in debug mode with gcc, force the nullMem variable in function columnMem() to be aligned to an 8-byte boundary. Otherwise an assert() statement may fail. (CVS 6723) check-in: 3fd6c72d user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.  This module is responsible for
    14     14   ** generating the code that loops through a table looking for applicable
    15     15   ** rows.  Indices are selected and used to speed the search when doing
    16     16   ** so is applicable.  Because this module is responsible for selecting
    17     17   ** indices, you might also think of this module as the "query optimizer".
    18     18   **
    19         -** $Id: where.c,v 1.400 2009/06/03 01:24:54 drh Exp $
           19  +** $Id: where.c,v 1.401 2009/06/06 15:17:28 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   
    23     23   /*
    24     24   ** Trace output macros
    25     25   */
    26     26   #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
................................................................................
  3547   3547       ** 
  3548   3548       ** Calls to the code generator in between sqlite3WhereBegin and
  3549   3549       ** sqlite3WhereEnd will have created code that references the table
  3550   3550       ** directly.  This loop scans all that code looking for opcodes
  3551   3551       ** that reference the table and converts them into opcodes that
  3552   3552       ** reference the index.
  3553   3553       */
  3554         -    if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
         3554  +    if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
  3555   3555         int k, j, last;
  3556   3556         VdbeOp *pOp;
  3557   3557         Index *pIdx = pLevel->plan.u.pIdx;
  3558   3558         int useIndexOnly = pLevel->plan.wsFlags & WHERE_IDX_ONLY;
  3559   3559   
  3560   3560         assert( pIdx!=0 );
  3561   3561         pOp = sqlite3VdbeGetOp(v, pWInfo->iTop);