/ Check-in [d43dcbc4]
Login

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

Overview
Comment:Add a testcase() macro to verify OOM coverage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d43dcbc488120aeb7104ab9e6a27f62bb348bf6a
User & Date: drh 2013-08-06 17:24:23
Context
2013-08-06
18:21
Update the configure script to use the latest version number (3.8.0). check-in: 52e8ec5e user: drh tags: trunk
17:24
Add a testcase() macro to verify OOM coverage. check-in: d43dcbc4 user: drh tags: trunk
16:56
Remove unreachable branches in expr.c, replacing them with assert() and testcase() statements. check-in: 9103c27c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  1730   1730           ExprList *pEList;
  1731   1731   
  1732   1732           assert( !isRowid );
  1733   1733           sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
  1734   1734           dest.affSdst = (u8)affinity;
  1735   1735           assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
  1736   1736           pExpr->x.pSelect->iLimit = 0;
         1737  +        testcase( pKeyInfo==0 ); /* Caused by OOM in sqlite3KeyInfoAlloc() */
  1737   1738           if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
  1738   1739             sqlite3DbFree(pParse->db, pKeyInfo);
  1739   1740             return 0;
  1740   1741           }
  1741   1742           pEList = pExpr->x.pSelect->pEList;
  1742         -        assert( pKeyInfo!=0 ); /* OOM will exit after sqlite3Select() */
         1743  +        assert( pKeyInfo!=0 ); /* OOM will cause exit after sqlite3Select() */
  1743   1744           assert( pEList!=0 );
  1744   1745           assert( pEList->nExpr>0 );
  1745   1746           pKeyInfo->aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft,
  1746   1747                                                            pEList->a[0].pExpr);
  1747   1748         }else if( ALWAYS(pExpr->x.pList!=0) ){
  1748   1749           /* Case 2:     expr IN (exprlist)
  1749   1750           **