/ Check-in [4f2bcff9]
Login

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

Overview
Comment:Remove unreachable branches from the decltype computation logic in the query planner.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4f2bcff94c672312805be1400050a7026f93a9d7
User & Date: drh 2015-12-02 19:46:12
Context
2015-12-03
01:48
A unix VFS change replaces fsync() with fstat() when using SQLITE_NO_SYNC, so set PRAGMA synchronous=OFF in the sysfault-3 test to avoid erroneously causing errors in xSync. check-in: 4f7f3550 user: drh tags: trunk
2015-12-02
20:53
Merge recent enhancements from trunk. check-in: 9130661a user: drh tags: begin-concurrent
20:40
Merge recent enhancements from trunk. check-in: d1a1278d user: drh tags: sessions
20:22
Merge all recent trunk enhancements, especially the unix VFS changes. check-in: e1fb33c7 user: drh tags: apple-osx
19:46
Remove unreachable branches from the decltype computation logic in the query planner. check-in: 4f2bcff9 user: drh tags: trunk
18:59
Have the sqlite3_column_decltype() API report the declared types for the left-most SELECT statement in a compound SELECT. check-in: 3e1d71fc user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  1336   1336     u8 estWidth = 1;
  1337   1337   #ifdef SQLITE_ENABLE_COLUMN_METADATA
  1338   1338     char const *zOrigDb = 0;
  1339   1339     char const *zOrigTab = 0;
  1340   1340     char const *zOrigCol = 0;
  1341   1341   #endif
  1342   1342   
  1343         -  if( NEVER(pExpr==0) || pNC->pSrcList==0 ) return 0;
         1343  +  assert( pExpr!=0 );
         1344  +  assert( pNC->pSrcList!=0 );
  1344   1345     switch( pExpr->op ){
  1345   1346       case TK_AGG_COLUMN:
  1346   1347       case TK_COLUMN: {
  1347   1348         /* The expression is a column. Locate the table the column is being
  1348   1349         ** extracted from in NameContext.pSrcList. This table may be real
  1349   1350         ** database table or a subquery.
  1350   1351         */
................................................................................
  1524   1525   #ifndef SQLITE_OMIT_EXPLAIN
  1525   1526     /* If this is an EXPLAIN, skip this step */
  1526   1527     if( pParse->explain ){
  1527   1528       return;
  1528   1529     }
  1529   1530   #endif
  1530   1531   
         1532  +  assert( pTabList!=0 );
  1531   1533     if( pParse->colNamesSet || NEVER(v==0) || db->mallocFailed ) return;
  1532   1534     pParse->colNamesSet = 1;
  1533   1535     fullNames = (db->flags & SQLITE_FullColNames)!=0;
  1534   1536     shortNames = (db->flags & SQLITE_ShortColNames)!=0;
  1535   1537     sqlite3VdbeSetNumCols(v, pEList->nExpr);
  1536   1538     for(i=0; i<pEList->nExpr; i++){
  1537   1539       Expr *p;
  1538   1540       p = pEList->a[i].pExpr;
  1539   1541       if( NEVER(p==0) ) continue;
  1540   1542       if( pEList->a[i].zName ){
  1541   1543         char *zName = pEList->a[i].zName;
  1542   1544         sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT);
  1543         -    }else if( (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) && pTabList ){
         1545  +    }else if( p->op==TK_COLUMN || p->op==TK_AGG_COLUMN ){
  1544   1546         Table *pTab;
  1545   1547         char *zCol;
  1546   1548         int iCol = p->iColumn;
  1547   1549         for(j=0; ALWAYS(j<pTabList->nSrc); j++){
  1548   1550           if( pTabList->a[j].iCursor==p->iTable ) break;
  1549   1551         }
  1550   1552         assert( j<pTabList->nSrc );