/ Check-in [f1ba68f1]
Login

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

Overview
Comment:Fix the SELECTTRACE_ENABLE macro so that it doesn't cause problems for testfixture. Add new SELECTTRACE() calls.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | select-trace
Files: files | file ages | folders
SHA1: f1ba68f131d2f03e4a7bc50cde23a7609d384279
User & Date: drh 2014-09-20 20:24:49
Context
2014-09-20
20:38
Candidate fix for [d11a6e908f]. check-in: 89398880 user: dan tags: select-trace
20:24
Fix the SELECTTRACE_ENABLE macro so that it doesn't cause problems for testfixture. Add new SELECTTRACE() calls. check-in: f1ba68f1 user: drh tags: select-trace
18:18
Enable SELECT query planning tracing when compiled with SQLITE_ENABLE_SELECTTRACE and either SQLITE_DEBUG or SQLITE_TEST. check-in: cbe0cf9d user: drh tags: select-trace
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  1065   1065     pNew->iLimit = 0;
  1066   1066     pNew->iOffset = 0;
  1067   1067     pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
  1068   1068     pNew->addrOpenEphm[0] = -1;
  1069   1069     pNew->addrOpenEphm[1] = -1;
  1070   1070     pNew->nSelectRow = p->nSelectRow;
  1071   1071     pNew->pWith = withDup(db, p->pWith);
         1072  +#if SELECTTRACE_ENABLED
         1073  +  memcpy(pNew->zSelLabel, p->zSelLabel, sizeof(p->zSelLabel));
         1074  +#endif
  1072   1075     return pNew;
  1073   1076   }
  1074   1077   #else
  1075   1078   Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
  1076   1079     assert( p==0 );
  1077   1080     return 0;
  1078   1081   }

Changes to src/select.c.

  4608   4608   
  4609   4609     db = pParse->db;
  4610   4610     if( p==0 || db->mallocFailed || pParse->nErr ){
  4611   4611       return 1;
  4612   4612     }
  4613   4613     if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
  4614   4614     memset(&sAggInfo, 0, sizeof(sAggInfo));
         4615  +  SELECTTRACE(1, ("begin processing %s\n", p->zSelLabel));
  4615   4616   
  4616   4617     assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
  4617   4618     assert( p->pOrderBy==0 || pDest->eDest!=SRT_Fifo );
  4618   4619     assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue );
  4619   4620     assert( p->pOrderBy==0 || pDest->eDest!=SRT_Queue );
  4620   4621     if( IgnorableOrderby(pDest) ){
  4621   4622       assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || 
................................................................................
  5363   5364     */
  5364   5365     if( rc==SQLITE_OK && pDest->eDest==SRT_Output ){
  5365   5366       generateColumnNames(pParse, pTabList, pEList);
  5366   5367     }
  5367   5368   
  5368   5369     sqlite3DbFree(db, sAggInfo.aCol);
  5369   5370     sqlite3DbFree(db, sAggInfo.aFunc);
         5371  +  SELECTTRACE(1, ("end processing %s\n", p->zSelLabel));
  5370   5372     return rc;
  5371   5373   }
  5372   5374   
  5373   5375   #if defined(SQLITE_ENABLE_TREE_EXPLAIN)
  5374   5376   /*
  5375   5377   ** Generate a human-readable description of a the Select object.
  5376   5378   */

Changes to src/sqliteInt.h.

   706    706   # undef SQLITE_ENABLE_STAT3_OR_STAT4
   707    707   #endif
   708    708   
   709    709   /*
   710    710   ** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
   711    711   ** the Select query generator tracing logic is turned on.
   712    712   */
   713         -#if defined(SQLITE_DEBUG) \
   714         -    && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_SELECTTRACE))
          713  +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_SELECTTRACE)
   715    714   # define SELECTTRACE_ENABLED 1
   716    715   #else
   717    716   # define SELECTTRACE_ENABLED 0
   718    717   #endif
   719    718   
   720    719   /*
   721    720   ** An instance of the following structure is used to store the busy-handler