/ Check-in [5bf2ccb9]
Login

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

Overview
Comment:Simplification to sqlite3SelectPrep() for improved testability.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5bf2ccb908dc6ebf7e063014b0a4bed7e3e9e0a555f78c6b4f6647adfb7209e4
User & Date: drh 2017-10-02 23:30:45
Context
2017-10-02
23:50
Mark a single branch within sqlite3SelectExpand() as an optimization. check-in: 3a4ffb21 user: drh tags: trunk
23:30
Simplification to sqlite3SelectPrep() for improved testability. check-in: 5bf2ccb9 user: drh tags: trunk
21:29
Add the OK_IF_ALWAYS_TRUE() and OK_IF_ALWAYS_FALSE() macros for marking conditionals that improve performance but do not change the outcome. check-in: 6035c9b2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/select.c.

  4729   4729   ** This routine acts recursively on all subqueries within the SELECT.
  4730   4730   */
  4731   4731   void sqlite3SelectPrep(
  4732   4732     Parse *pParse,         /* The parser context */
  4733   4733     Select *p,             /* The SELECT statement being coded. */
  4734   4734     NameContext *pOuterNC  /* Name context for container */
  4735   4735   ){
  4736         -  sqlite3 *db;
  4737         -  if( NEVER(p==0) ) return;
  4738         -  db = pParse->db;
  4739         -  if( db->mallocFailed ) return;
         4736  +  assert( p!=0 );
  4740   4737     if( p->selFlags & SF_HasTypeInfo ) return;
  4741   4738     sqlite3SelectExpand(pParse, p);
  4742         -  if( pParse->nErr || db->mallocFailed ) return;
         4739  +  if( pParse->nErr || pParse->db->mallocFailed ) return;
  4743   4740     sqlite3ResolveSelectNames(pParse, p, pOuterNC);
  4744         -  if( pParse->nErr || db->mallocFailed ) return;
         4741  +  if( pParse->nErr || pParse->db->mallocFailed ) return;
  4745   4742     sqlite3SelectAddTypeInfo(pParse, p);
  4746   4743   }
  4747   4744   
  4748   4745   /*
  4749   4746   ** Reset the aggregate accumulator.
  4750   4747   **
  4751   4748   ** The aggregate accumulator is a set of memory cells that hold