/ Check-in [860aa936]
Login

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

Overview
Comment:Don't try to verify the schema of transient table (such as generated inside a WITH clause) when generating code for "IN table" operators.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | common-table-expr
Files: files | file ages | folders
SHA1: 860aa936634a60d68e3954fc408a96a9260394e0
User & Date: drh 2014-01-15 14:40:41
Context
2014-01-15
15:27
Return an error if a CTE specifies a different number of columns than its SELECT statement returns. check-in: 9a514b50 user: dan tags: common-table-expr
14:40
Don't try to verify the schema of transient table (such as generated inside a WITH clause) when generating code for "IN table" operators. check-in: 860aa936 user: drh tags: common-table-expr
14:17
Disable the flattening optimization if the sub-query is a recursive CTE. check-in: 9472f6d8 user: dan tags: common-table-expr
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  1577   1577       assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
  1578   1578       assert( p->pSrc!=0 );               /* Because of isCandidateForInOpt(p) */
  1579   1579       pTab = p->pSrc->a[0].pTab;
  1580   1580       pExpr = p->pEList->a[0].pExpr;
  1581   1581       iCol = (i16)pExpr->iColumn;
  1582   1582      
  1583   1583       /* Code an OP_VerifyCookie and OP_TableLock for <table>. */
  1584         -    iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
  1585         -    sqlite3CodeVerifySchema(pParse, iDb);
  1586         -    sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
         1584  +    if( pTab->pSchema ){
         1585  +      iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
         1586  +      sqlite3CodeVerifySchema(pParse, iDb);
         1587  +      sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
         1588  +    }
  1587   1589   
  1588   1590       /* This function is only called from two places. In both cases the vdbe
  1589   1591       ** has already been allocated. So assume sqlite3GetVdbe() is always
  1590   1592       ** successful here.
  1591   1593       */
  1592   1594       assert(v);
  1593   1595       if( iCol<0 ){