/ Check-in [54f55d3b]
Login

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

Overview
Comment:The EP_Resolved flag on the Expr object is not required for correctness nor performance, so remove it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 54f55d3b7973e326541a81bfb2e752a2f6618e4fec9a3631b95f28e12e9c6e34
User & Date: drh 2017-07-12 17:08:24
Context
2017-07-12
17:26
Remove unnecessary EP_Leaf settings on the Expr object. check-in: f951c8b7 user: drh tags: trunk
17:08
The EP_Resolved flag on the Expr object is not required for correctness nor performance, so remove it. check-in: 54f55d3b user: drh tags: trunk
14:10
Clarification and simplification and result column naming logic. check-in: 68824a43 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

   894    894   }
   895    895   term(A) ::= FLOAT|BLOB(X). {spanExpr(&A,pParse,@X,X);/*A-overwrites-X*/}
   896    896   term(A) ::= STRING(X).     {spanExpr(&A,pParse,@X,X);/*A-overwrites-X*/}
   897    897   term(A) ::= INTEGER(X). {
   898    898     A.pExpr = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &X, 1);
   899    899     A.zStart = X.z;
   900    900     A.zEnd = X.z + X.n;
   901         -  if( A.pExpr ) A.pExpr->flags |= EP_Leaf|EP_Resolved;
          901  +  if( A.pExpr ) A.pExpr->flags |= EP_Leaf;
   902    902   }
   903    903   expr(A) ::= VARIABLE(X).     {
   904    904     if( !(X.z[0]=='#' && sqlite3Isdigit(X.z[1])) ){
   905    905       u32 n = X.n;
   906    906       spanExpr(&A, pParse, TK_VARIABLE, X);
   907    907       sqlite3ExprAssignVarNumber(pParse, A.pExpr, n);
   908    908     }else{

Changes to src/resolve.c.

   513    513         p->iColumn = -1;
   514    514       }else{
   515    515         p->iColumn = (ynVar)iCol;
   516    516         testcase( iCol==BMS );
   517    517         testcase( iCol==BMS-1 );
   518    518         pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
   519    519       }
   520         -    ExprSetProperty(p, EP_Resolved);
   521    520     }
   522    521     return p;
   523    522   }
   524    523   
   525    524   /*
   526    525   ** Report an error that an expression is not valid for some set of
   527    526   ** pNC->ncFlags values determined by validMask.
................................................................................
   573    572     Parse *pParse;
   574    573   
   575    574     pNC = pWalker->u.pNC;
   576    575     assert( pNC!=0 );
   577    576     pParse = pNC->pParse;
   578    577     assert( pParse==pWalker->pParse );
   579    578   
   580         -  if( ExprHasProperty(pExpr, EP_Resolved) ) return WRC_Prune;
   581         -  ExprSetProperty(pExpr, EP_Resolved);
   582    579   #ifndef NDEBUG
   583    580     if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){
   584    581       SrcList *pSrcList = pNC->pSrcList;
   585    582       int i;
   586    583       for(i=0; i<pNC->pSrcList->nSrc; i++){
   587    584         assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
   588    585       }

Changes to src/sqliteInt.h.

  2368   2368   };
  2369   2369   
  2370   2370   /*
  2371   2371   ** The following are the meanings of bits in the Expr.flags field.
  2372   2372   */
  2373   2373   #define EP_FromJoin  0x000001 /* Originates in ON/USING clause of outer join */
  2374   2374   #define EP_Agg       0x000002 /* Contains one or more aggregate functions */
  2375         -#define EP_Resolved  0x000004 /* IDs have been resolved to COLUMNs */
         2375  +                  /* 0x000004 // available for use */
  2376   2376                     /* 0x000008 // available for use */
  2377   2377   #define EP_Distinct  0x000010 /* Aggregate function with DISTINCT keyword */
  2378   2378   #define EP_VarSelect 0x000020 /* pSelect is correlated, not constant */
  2379   2379   #define EP_DblQuoted 0x000040 /* token.z was originally in "..." */
  2380   2380   #define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
  2381   2381   #define EP_Collate   0x000100 /* Tree contains a TK_COLLATE operator */
  2382   2382   #define EP_Generic   0x000200 /* Ignore COLLATE or affinity on this tree */