/ Check-in [374d8e26]
Login

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

Overview
Comment:Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 374d8e264487b0437a8d995ced1bc026a92d495a2d0568f65f033e9ebe11d0e2
User & Date: drh 2018-05-07 11:37:34
Context
2018-05-07
11:48
On an UPDATE, try to overwrite an existing btree cell with the modified content, if the old and new cell are the same size. Use memcmp() first to avoid dirtying pages that are unchanged. check-in: 5887d8be user: drh tags: trunk
11:37
Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. check-in: 374d8e26 user: drh tags: trunk
02:50
Backout change [05fee1a21ea398f1e4d6f1cf3] because it does not take into account the LD_LIBRARY_PATH environment variable used by dl_open(). check-in: b348d119 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  1718   1718     EQPGraphRow *pRow, *pNext;
  1719   1719     int n = strlen30(p->sGraph.zPrefix);
  1720   1720     char *z;
  1721   1721     for(pRow = eqp_next_row(p, iEqpId, 0); pRow; pRow = pNext){
  1722   1722       pNext = eqp_next_row(p, iEqpId, pRow);
  1723   1723       z = pRow->zText;
  1724   1724       utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, pNext ? "|--" : "`--", z);
  1725         -    if( n<sizeof(p->sGraph.zPrefix)-7 ){
         1725  +    if( n<(int)sizeof(p->sGraph.zPrefix)-7 ){
  1726   1726         memcpy(&p->sGraph.zPrefix[n], pNext ? "|  " : "   ", 4);
  1727   1727         eqp_render_level(p, pRow->iEqpId);
  1728   1728         p->sGraph.zPrefix[n] = 0;
  1729   1729       }
  1730   1730     }
  1731   1731   }
  1732   1732   

Changes to src/where.c.

  4984   4984       if( (pLevel->pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 ){
  4985   4985         constructAutomaticIndex(pParse, &pWInfo->sWC,
  4986   4986                   &pTabList->a[pLevel->iFrom], notReady, pLevel);
  4987   4987         if( db->mallocFailed ) goto whereBeginError;
  4988   4988       }
  4989   4989   #endif
  4990   4990       addrExplain = sqlite3WhereExplainOneScan(
  4991         -        pParse, pTabList, pLevel, ii, pLevel->iFrom, wctrlFlags
         4991  +        pParse, pTabList, pLevel, wctrlFlags
  4992   4992       );
  4993   4993       pLevel->addrBody = sqlite3VdbeCurrentAddr(v);
  4994   4994       notReady = sqlite3WhereCodeOneLoopStart(pWInfo, ii, notReady);
  4995   4995       pWInfo->iContinue = pLevel->addrCont;
  4996   4996       if( (wsFlags&WHERE_MULTI_OR)==0 && (wctrlFlags&WHERE_OR_SUBCLAUSE)==0 ){
  4997   4997         sqlite3WhereAddScanStatus(v, pTabList, pLevel, addrExplain);
  4998   4998       }

Changes to src/whereInt.h.

   463    463   
   464    464   /* wherecode.c: */
   465    465   #ifndef SQLITE_OMIT_EXPLAIN
   466    466   int sqlite3WhereExplainOneScan(
   467    467     Parse *pParse,                  /* Parse context */
   468    468     SrcList *pTabList,              /* Table list this loop refers to */
   469    469     WhereLevel *pLevel,             /* Scan to write OP_Explain opcode for */
   470         -  int iLevel,                     /* Value for "level" column of output */
   471         -  int iFrom,                      /* Value for "from" column of output */
   472    470     u16 wctrlFlags                  /* Flags passed to sqlite3WhereBegin() */
   473    471   );
   474    472   #else
   475         -# define sqlite3WhereExplainOneScan(u,v,w,x,y,z) 0
          473  +# define sqlite3WhereExplainOneScan(u,v,w,x) 0
   476    474   #endif /* SQLITE_OMIT_EXPLAIN */
   477    475   #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
   478    476   void sqlite3WhereAddScanStatus(
   479    477     Vdbe *v,                        /* Vdbe to add scanstatus entry to */
   480    478     SrcList *pSrclist,              /* FROM clause pLvl reads data from */
   481    479     WhereLevel *pLvl,               /* Level to add scanstatus() entry for */
   482    480     int addrExplain                 /* Address of OP_Explain (or 0) */

Changes to src/wherecode.c.

   118    118   ** If an OP_Explain opcode is added to the VM, its address is returned.
   119    119   ** Otherwise, if no OP_Explain is coded, zero is returned.
   120    120   */
   121    121   int sqlite3WhereExplainOneScan(
   122    122     Parse *pParse,                  /* Parse context */
   123    123     SrcList *pTabList,              /* Table list this loop refers to */
   124    124     WhereLevel *pLevel,             /* Scan to write OP_Explain opcode for */
   125         -  int iLevel,                     /* Value for "level" column of output */
   126         -  int iFrom,                      /* Value for "from" column of output */
   127    125     u16 wctrlFlags                  /* Flags passed to sqlite3WhereBegin() */
   128    126   ){
   129    127     int ret = 0;
   130    128   #if !defined(SQLITE_DEBUG) && !defined(SQLITE_ENABLE_STMT_SCANSTATUS)
   131    129     if( sqlite3ParseToplevel(pParse)->explain==2 )
   132    130   #endif
   133    131     {
................................................................................
  1952   1950           WHERETRACE(0xffff, ("Subplan for OR-clause:\n"));
  1953   1951           pSubWInfo = sqlite3WhereBegin(pParse, pOrTab, pOrExpr, 0, 0,
  1954   1952                                         wctrlFlags, iCovCur);
  1955   1953           assert( pSubWInfo || pParse->nErr || db->mallocFailed );
  1956   1954           if( pSubWInfo ){
  1957   1955             WhereLoop *pSubLoop;
  1958   1956             int addrExplain = sqlite3WhereExplainOneScan(
  1959         -              pParse, pOrTab, &pSubWInfo->a[0], iLevel, pLevel->iFrom, 0
         1957  +              pParse, pOrTab, &pSubWInfo->a[0], 0
  1960   1958             );
  1961   1959             sqlite3WhereAddScanStatus(v, pOrTab, &pSubWInfo->a[0], addrExplain);
  1962   1960   
  1963   1961             /* This is the sub-WHERE clause body.  First skip over
  1964   1962             ** duplicate rows from prior sub-WHERE clauses, and record the
  1965   1963             ** rowid (or PRIMARY KEY) for the current row so that the same
  1966   1964             ** row will be skipped in subsequent sub-WHERE clauses.