/ Check-in [ed0bfcfa]
Login

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

Overview
Comment:Merge updates from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winIoRetry
Files: files | file ages | folders
SHA1: ed0bfcfadc07507a38f2c2387d85515ba1eb2722
User & Date: mistachkin 2014-02-27 05:47:31
Context
2014-05-02
21:42
Merge updates from trunk. Closed-Leaf check-in: 598a3875 user: mistachkin tags: winIoRetry
2014-02-27
05:47
Merge updates from trunk. check-in: ed0bfcfa user: mistachkin tags: winIoRetry
2014-02-26
21:35
More efficient removal of duplicates in recursive queries using the UNION compound operator. check-in: 06c2db87 user: drh tags: trunk
2014-02-18
05:18
Enhance the Win32 VFS I/O retry logic. check-in: adba783c user: mistachkin tags: winIoRetry
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

  1315   1315   
  1316   1316   testfixture.exe:	$(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
  1317   1317   	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
  1318   1318   		-DBUILD_sqlite -I$(TCLINCDIR) \
  1319   1319   		$(TESTFIXTURE_SRC) \
  1320   1320   		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  1321   1321   
         1322  +extensiontest: testfixture.exe testloadext.dll
         1323  +	.\testfixture.exe $(TOP)\test\loadext.test
         1324  +
  1322   1325   fulltest:	testfixture.exe sqlite3.exe
  1323   1326   	.\testfixture.exe $(TOP)\test\all.test
  1324   1327   
  1325   1328   soaktest:	testfixture.exe sqlite3.exe
  1326   1329   	.\testfixture.exe $(TOP)\test\all.test -soak=1
  1327   1330   
  1328   1331   fulltestonly:	testfixture.exe sqlite3.exe
................................................................................
  1341   1344   	$(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
  1342   1345   	echo ; return zMainloop; } >> $@
  1343   1346   
  1344   1347   sqlite3_analyzer.exe:	sqlite3_analyzer.c $(LIBRESOBJS)
  1345   1348   	$(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
  1346   1349   		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  1347   1350   
         1351  +testloadext.lo:	$(TOP)\src\test_loadext.c
         1352  +	$(LTCOMPILE) -c $(TOP)\src\test_loadext.c
         1353  +
         1354  +testloadext.dll: testloadext.lo
         1355  +	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
         1356  +
  1348   1357   showdb.exe:	$(TOP)\tool\showdb.c $(SQLITE3C)
  1349   1358   	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
  1350   1359   		$(TOP)\tool\showdb.c $(SQLITE3C)
  1351   1360   
  1352   1361   wordcount.exe:	$(TOP)\test\wordcount.c $(SQLITE3C)
  1353   1362   	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
  1354   1363   		$(TOP)\test\wordcount.c $(SQLITE3C)
................................................................................
  1359   1368   
  1360   1369   clean:
  1361   1370   	del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
  1362   1371   	del /Q *.cod *.da *.bb *.bbg gmon.out
  1363   1372   	del /Q sqlite3.h opcodes.c opcodes.h
  1364   1373   	del /Q lemon.exe lempar.c parse.*
  1365   1374   	del /Q mkkeywordhash.exe keywordhash.h
         1375  +	del /Q notasharedlib.*
  1366   1376   	-rmdir /Q/S .deps
  1367   1377   	-rmdir /Q/S .libs
  1368   1378   	-rmdir /Q/S quota2a
  1369   1379   	-rmdir /Q/S quota2b
  1370   1380   	-rmdir /Q/S quota2c
  1371   1381   	-rmdir /Q/S tsrc
  1372   1382   	del /Q .target_source
  1373   1383   	del /Q tclsqlite3.exe tclsqlite3.exp
         1384  +	del /Q testloadext.dll testloadext.exp
  1374   1385   	del /Q testfixture.exe testfixture.exp test.db
  1375   1386   	del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
  1376   1387   	del /Q sqlite3.c sqlite3-*.c
  1377   1388   	del /Q sqlite3rc.h
  1378   1389   	del /Q shell.c sqlite3ext.h
  1379   1390   	del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
  1380   1391   	del /Q sqlite-*-output.vsix

Changes to src/alter.c.

    73     73         do {
    74     74           zCsr += len;
    75     75           len = sqlite3GetToken(zCsr, &token);
    76     76         } while( token==TK_SPACE );
    77     77         assert( len>0 );
    78     78       } while( token!=TK_LP && token!=TK_USING );
    79     79   
    80         -    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql, 
    81         -       zTableName, tname.z+tname.n);
           80  +    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
           81  +       zSql, zTableName, tname.z+tname.n);
    82     82       sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
    83     83     }
    84     84   }
    85     85   
    86     86   /*
    87     87   ** This C function implements an SQL user function that is used by SQL code
    88     88   ** generated by the ALTER TABLE ... RENAME command to modify the definition
................................................................................
   126    126         }while( token==TK_SPACE );
   127    127   
   128    128         zParent = sqlite3DbStrNDup(db, (const char *)z, n);
   129    129         if( zParent==0 ) break;
   130    130         sqlite3Dequote(zParent);
   131    131         if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
   132    132           char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", 
   133         -            (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
          133  +            (zOutput?zOutput:""), (int)(z-zInput), zInput, (const char *)zNew
   134    134           );
   135    135           sqlite3DbFree(db, zOutput);
   136    136           zOutput = zOut;
   137    137           zInput = &z[n];
   138    138         }
   139    139         sqlite3DbFree(db, zParent);
   140    140       }
................................................................................
   212    212           dist = 0;
   213    213         }
   214    214       } while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) );
   215    215   
   216    216       /* Variable tname now contains the token that is the old table-name
   217    217       ** in the CREATE TRIGGER statement.
   218    218       */
   219         -    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql, 
   220         -       zTableName, tname.z+tname.n);
          219  +    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
          220  +       zSql, zTableName, tname.z+tname.n);
   221    221       sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
   222    222     }
   223    223   }
   224    224   #endif   /* !SQLITE_OMIT_TRIGGER */
   225    225   
   226    226   /*
   227    227   ** Register built-in functions used to help implement ALTER TABLE
................................................................................
   600    600     if( ALWAYS(v) ){
   601    601       int r1 = sqlite3GetTempReg(pParse);
   602    602       int r2 = sqlite3GetTempReg(pParse);
   603    603       int j1;
   604    604       sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT);
   605    605       sqlite3VdbeUsesBtree(v, iDb);
   606    606       sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2);
   607         -    j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); VdbeCoverage(v);
          607  +    j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1);
          608  +    sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); VdbeCoverage(v);
   608    609       sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, r2);
   609    610       sqlite3VdbeJumpHere(v, j1);
   610    611       sqlite3ReleaseTempReg(pParse, r1);
   611    612       sqlite3ReleaseTempReg(pParse, r2);
   612    613     }
   613    614   }
   614    615   

Changes to src/delete.c.

   609    609     /* Seek cursor iCur to the row to delete. If this row no longer exists 
   610    610     ** (this can happen if a trigger program has already deleted it), do
   611    611     ** not attempt to delete it or fire any DELETE triggers.  */
   612    612     iLabel = sqlite3VdbeMakeLabel(v);
   613    613     opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
   614    614     if( !bNoSeek ){
   615    615       sqlite3VdbeAddOp4Int(v, opSeek, iDataCur, iLabel, iPk, nPk);
   616         -    VdbeCoverage(v);
          616  +    VdbeCoverageIf(v, opSeek==OP_NotExists);
          617  +    VdbeCoverageIf(v, opSeek==OP_NotFound);
   617    618     }
   618    619    
   619    620     /* If there are any triggers to fire, allocate a range of registers to
   620    621     ** use for the old.* references in the triggers.  */
   621    622     if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
   622    623       u32 mask;                     /* Mask of OLD.* columns in use */
   623    624       int iCol;                     /* Iterator used while populating OLD.* */
................................................................................
   652    653       /* If any BEFORE triggers were coded, then seek the cursor to the 
   653    654       ** row to be deleted again. It may be that the BEFORE triggers moved
   654    655       ** the cursor or of already deleted the row that the cursor was
   655    656       ** pointing to.
   656    657       */
   657    658       if( addrStart<sqlite3VdbeCurrentAddr(v) ){
   658    659         sqlite3VdbeAddOp4Int(v, opSeek, iDataCur, iLabel, iPk, nPk);
   659         -      VdbeCoverage(v);
          660  +      VdbeCoverageIf(v, opSeek==OP_NotExists);
          661  +      VdbeCoverageIf(v, opSeek==OP_NotFound);
   660    662       }
   661    663   
   662    664       /* Do FK processing. This call checks that any FK constraints that
   663    665       ** refer to this table (i.e. constraints attached to other tables) 
   664    666       ** are not violated by deleting this row.  */
   665    667       sqlite3FkCheck(pParse, pTab, iOld, 0, 0, 0);
   666    668     }

Changes to src/fkey.c.

   365    365     
   366    366         /* If the parent table is the same as the child table, and we are about
   367    367         ** to increment the constraint-counter (i.e. this is an INSERT operation),
   368    368         ** then check if the row being inserted matches itself. If so, do not
   369    369         ** increment the constraint-counter.  */
   370    370         if( pTab==pFKey->pFrom && nIncr==1 ){
   371    371           sqlite3VdbeAddOp3(v, OP_Eq, regData, iOk, regTemp); VdbeCoverage(v);
          372  +        sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
   372    373         }
   373    374     
   374    375         sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
   375    376         sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, regTemp); VdbeCoverage(v);
   376    377         sqlite3VdbeAddOp2(v, OP_Goto, 0, iOk);
   377    378         sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2);
   378    379         sqlite3VdbeJumpHere(v, iMustBeInt);

Changes to src/insert.c.

   300    300     AutoincInfo *p;
   301    301     Vdbe *v = pParse->pVdbe;
   302    302     sqlite3 *db = pParse->db;
   303    303   
   304    304     assert( v );
   305    305     for(p = pParse->pAinc; p; p = p->pNext){
   306    306       Db *pDb = &db->aDb[p->iDb];
   307         -    int j1, j2, j3, j4, j5;
          307  +    int j1;
   308    308       int iRec;
   309    309       int memId = p->regCtr;
   310    310   
   311    311       iRec = sqlite3GetTempReg(pParse);
   312    312       assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
   313    313       sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
   314    314       j1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v);
   315         -    j2 = sqlite3VdbeAddOp0(v, OP_Rewind); VdbeCoverage(v);
   316         -    j3 = sqlite3VdbeAddOp3(v, OP_Column, 0, 0, iRec);
   317         -    j4 = sqlite3VdbeAddOp3(v, OP_Eq, memId-1, 0, iRec); VdbeCoverage(v);
   318         -    sqlite3VdbeAddOp2(v, OP_Next, 0, j3); VdbeCoverage(v);
   319         -    sqlite3VdbeJumpHere(v, j2);
   320    315       sqlite3VdbeAddOp2(v, OP_NewRowid, 0, memId+1);
   321         -    j5 = sqlite3VdbeAddOp0(v, OP_Goto);
   322         -    sqlite3VdbeJumpHere(v, j4);
   323         -    sqlite3VdbeAddOp2(v, OP_Rowid, 0, memId+1);
   324    316       sqlite3VdbeJumpHere(v, j1);
   325         -    sqlite3VdbeJumpHere(v, j5);
   326    317       sqlite3VdbeAddOp3(v, OP_MakeRecord, memId-1, 2, iRec);
   327    318       sqlite3VdbeAddOp3(v, OP_Insert, 0, iRec, memId+1);
   328    319       sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
   329    320       sqlite3VdbeAddOp0(v, OP_Close);
   330    321       sqlite3ReleaseTempReg(pParse, iRec);
   331    322     }
   332    323   }
................................................................................
   682    673         **      L: yield X, goto M at EOF
   683    674         **         insert row from R..R+n into temp table
   684    675         **         goto L
   685    676         **      M: ...
   686    677         */
   687    678         int regRec;          /* Register to hold packed record */
   688    679         int regTempRowid;    /* Register to hold temp table ROWID */
   689         -      int addrTop;         /* Label "L" */
          680  +      int addrL;           /* Label "L" */
   690    681   
   691    682         srcTab = pParse->nTab++;
   692    683         regRec = sqlite3GetTempReg(pParse);
   693    684         regTempRowid = sqlite3GetTempReg(pParse);
   694    685         sqlite3VdbeAddOp2(v, OP_OpenEphemeral, srcTab, nColumn);
   695         -      addrTop = sqlite3VdbeAddOp1(v, OP_Yield, dest.iSDParm); VdbeCoverage(v);
          686  +      addrL = sqlite3VdbeAddOp1(v, OP_Yield, dest.iSDParm); VdbeCoverage(v);
   696    687         sqlite3VdbeAddOp3(v, OP_MakeRecord, regFromSelect, nColumn, regRec);
   697    688         sqlite3VdbeAddOp2(v, OP_NewRowid, srcTab, regTempRowid);
   698    689         sqlite3VdbeAddOp3(v, OP_Insert, srcTab, regRec, regTempRowid);
   699         -      sqlite3VdbeAddOp2(v, OP_Goto, 0, addrTop);
   700         -      sqlite3VdbeJumpHere(v, addrTop);
          690  +      sqlite3VdbeAddOp2(v, OP_Goto, 0, addrL);
          691  +      sqlite3VdbeJumpHere(v, addrL);
   701    692         sqlite3ReleaseTempReg(pParse, regRec);
   702    693         sqlite3ReleaseTempReg(pParse, regTempRowid);
   703    694       }
   704    695     }else{
   705    696       /* This is the case if the data for the INSERT is coming from a VALUES
   706    697       ** clause
   707    698       */
................................................................................
  1271   1262       }
  1272   1263   
  1273   1264       if( isUpdate ){
  1274   1265         /* pkChng!=0 does not mean that the rowid has change, only that
  1275   1266         ** it might have changed.  Skip the conflict logic below if the rowid
  1276   1267         ** is unchanged. */
  1277   1268         sqlite3VdbeAddOp3(v, OP_Eq, regNewData, addrRowidOk, regOldData);
         1269  +      sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
  1278   1270         VdbeCoverage(v);
  1279   1271       }
  1280   1272   
  1281   1273       /* If the response to a rowid conflict is REPLACE but the response
  1282   1274       ** to some other UNIQUE constraint is FAIL or IGNORE, then we need
  1283   1275       ** to defer the running of the rowid conflict checking until after
  1284   1276       ** the UNIQUE constraints have run.
................................................................................
  1442   1434       if( isUpdate || onError==OE_Replace ){
  1443   1435         if( HasRowid(pTab) ){
  1444   1436           sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR);
  1445   1437           /* Conflict only if the rowid of the existing index entry
  1446   1438           ** is different from old-rowid */
  1447   1439           if( isUpdate ){
  1448   1440             sqlite3VdbeAddOp3(v, OP_Eq, regR, addrUniqueOk, regOldData);
         1441  +          sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
  1449   1442             VdbeCoverage(v);
  1450   1443           }
  1451   1444         }else{
  1452   1445           int x;
  1453   1446           /* Extract the PRIMARY KEY from the end of the index entry and
  1454   1447           ** store it in registers regR..regR+nPk-1 */
  1455   1448           if( pIdx!=pPk ){
................................................................................
  1477   1470               x = pPk->aiColumn[i];
  1478   1471               if( i==(pPk->nKeyCol-1) ){
  1479   1472                 addrJump = addrUniqueOk;
  1480   1473                 op = OP_Eq;
  1481   1474               }
  1482   1475               sqlite3VdbeAddOp4(v, op, 
  1483   1476                   regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ
  1484         -            );  VdbeCoverage(v);
         1477  +            );
         1478  +            sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
         1479  +            VdbeCoverageIf(v, op==OP_Eq);
         1480  +            VdbeCoverageIf(v, op==OP_Ne);
  1485   1481             }
  1486   1482           }
  1487   1483         }
  1488   1484       }
  1489   1485   
  1490   1486       /* Generate code that executes if the new index entry is not unique */
  1491   1487       assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail

Changes to src/mem5.c.

   270    270     mem5.nAlloc++;
   271    271     mem5.totalAlloc += iFullSz;
   272    272     mem5.totalExcess += iFullSz - nByte;
   273    273     mem5.currentCount++;
   274    274     mem5.currentOut += iFullSz;
   275    275     if( mem5.maxCount<mem5.currentCount ) mem5.maxCount = mem5.currentCount;
   276    276     if( mem5.maxOut<mem5.currentOut ) mem5.maxOut = mem5.currentOut;
          277  +
          278  +#ifdef SQLITE_DEBUG
          279  +  /* Make sure the allocated memory does not assume that it is set to zero
          280  +  ** or retains a value from a previous allocation */
          281  +  memset(&mem5.zPool[i*mem5.szAtom], 0xAA, iFullSz);
          282  +#endif
   277    283   
   278    284     /* Return a pointer to the allocated memory. */
   279    285     return (void*)&mem5.zPool[i*mem5.szAtom];
   280    286   }
   281    287   
   282    288   /*
   283    289   ** Free an outstanding memory allocation.
................................................................................
   328    334         iBlock = iBuddy;
   329    335       }else{
   330    336         mem5.aCtrl[iBlock] = CTRL_FREE | iLogsize;
   331    337         mem5.aCtrl[iBuddy] = 0;
   332    338       }
   333    339       size *= 2;
   334    340     }
          341  +
          342  +#ifdef SQLITE_DEBUG
          343  +  /* Overwrite freed memory with the 0x55 bit pattern to verify that it is
          344  +  ** not used after being freed */
          345  +  memset(&mem5.zPool[iBlock*mem5.szAtom], 0x55, size);
          346  +#endif
          347  +
   335    348     memsys5Link(iBlock, iLogsize);
   336    349   }
   337    350   
   338    351   /*
   339    352   ** Allocate nBytes of memory.
   340    353   */
   341    354   static void *memsys5Malloc(int nBytes){

Changes to src/os_win.c.

  5162   5162   }
  5163   5163   
  5164   5164   #ifndef SQLITE_OMIT_LOAD_EXTENSION
  5165   5165   /*
  5166   5166   ** Interfaces for opening a shared library, finding entry points
  5167   5167   ** within the shared library, and closing the shared library.
  5168   5168   */
  5169         -/*
  5170         -** Interfaces for opening a shared library, finding entry points
  5171         -** within the shared library, and closing the shared library.
  5172         -*/
  5173   5169   static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
  5174   5170     HANDLE h;
  5175   5171     void *zConverted = winConvertFromUtf8Filename(zFilename);
  5176   5172     UNUSED_PARAMETER(pVfs);
  5177   5173     if( zConverted==0 ){
         5174  +    OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
  5178   5175       return 0;
  5179   5176     }
  5180   5177     if( osIsNT() ){
  5181   5178   #if SQLITE_OS_WINRT
  5182   5179       h = osLoadPackagedLibrary((LPCWSTR)zConverted, 0);
  5183   5180   #else
  5184   5181       h = osLoadLibraryW((LPCWSTR)zConverted);
................................................................................
  5185   5182   #endif
  5186   5183     }
  5187   5184   #ifdef SQLITE_WIN32_HAS_ANSI
  5188   5185     else{
  5189   5186       h = osLoadLibraryA((char*)zConverted);
  5190   5187     }
  5191   5188   #endif
         5189  +  OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)h));
  5192   5190     sqlite3_free(zConverted);
  5193   5191     return (void*)h;
  5194   5192   }
  5195   5193   static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
  5196   5194     UNUSED_PARAMETER(pVfs);
  5197   5195     winGetLastErrorMsg(osGetLastError(), nBuf, zBufOut);
  5198   5196   }
  5199   5197   static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
         5198  +  FARPROC proc;
  5200   5199     UNUSED_PARAMETER(pVfs);
  5201         -  return (void(*)(void))osGetProcAddressA((HANDLE)pH, zSym);
         5200  +  proc = osGetProcAddressA((HANDLE)pH, zSym);
         5201  +  OSTRACE(("DLSYM handle=%p, symbol=%s, address=%p\n",
         5202  +           (void*)pH, zSym, (void*)proc));
         5203  +  return (void(*)(void))proc;
  5202   5204   }
  5203   5205   static void winDlClose(sqlite3_vfs *pVfs, void *pHandle){
  5204   5206     UNUSED_PARAMETER(pVfs);
  5205   5207     osFreeLibrary((HANDLE)pHandle);
         5208  +  OSTRACE(("DLCLOSE handle=%p\n", (void*)pHandle));
  5206   5209   }
  5207   5210   #else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */
  5208   5211     #define winDlOpen  0
  5209   5212     #define winDlError 0
  5210   5213     #define winDlSym   0
  5211   5214     #define winDlClose 0
  5212   5215   #endif

Changes to src/parse.y.

   433    433     }
   434    434     A = p;
   435    435   }
   436    436   
   437    437   selectnowith(A) ::= oneselect(X).                      {A = X;}
   438    438   %ifndef SQLITE_OMIT_COMPOUND_SELECT
   439    439   selectnowith(A) ::= selectnowith(X) multiselect_op(Y) oneselect(Z).  {
   440         -  if( Z ){
   441         -    Z->op = (u8)Y;
   442         -    Z->pPrior = X;
          440  +  Select *pRhs = Z;
          441  +  if( pRhs && pRhs->pPrior ){
          442  +    SrcList *pFrom;
          443  +    Token x;
          444  +    x.n = 0;
          445  +    pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0);
          446  +    pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0,0);
          447  +  }
          448  +  if( pRhs ){
          449  +    pRhs->op = (u8)Y;
          450  +    pRhs->pPrior = X;
   443    451       if( Y!=TK_ALL ) pParse->hasCompound = 1;
   444    452     }else{
   445    453       sqlite3SelectDelete(pParse->db, X);
   446    454     }
   447         -  A = Z;
          455  +  A = pRhs;
   448    456   }
   449    457   %type multiselect_op {int}
   450    458   multiselect_op(A) ::= UNION(OP).             {A = @OP;}
   451    459   multiselect_op(A) ::= UNION ALL.             {A = TK_ALL;}
   452    460   multiselect_op(A) ::= EXCEPT|INTERSECT(OP).  {A = @OP;}
   453    461   %endif SQLITE_OMIT_COMPOUND_SELECT
   454    462   oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y)

Changes to src/pragma.c.

  1938   1938           for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
  1939   1939             if( pPk==pIdx ) continue;
  1940   1940             addr = sqlite3VdbeCurrentAddr(v);
  1941   1941             sqlite3VdbeAddOp2(v, OP_IfPos, 1, addr+2); VdbeCoverage(v);
  1942   1942             sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
  1943   1943             sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
  1944   1944             sqlite3VdbeAddOp3(v, OP_Eq, 8+j, addr+8, 3); VdbeCoverage(v);
         1945  +          sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
  1945   1946             sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1);
  1946   1947             sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, pIdx->zName, P4_TRANSIENT);
  1947   1948             sqlite3VdbeAddOp3(v, OP_Concat, 3, 2, 7);
  1948   1949             sqlite3VdbeAddOp2(v, OP_ResultRow, 7, 1);
  1949   1950           }
  1950   1951   #endif /* SQLITE_OMIT_BTREECOUNT */
  1951   1952         } 

Changes to src/select.c.

   814    814         ExprList *pSO;
   815    815         pSO = pDest->pOrderBy;
   816    816         assert( pSO );
   817    817         nKey = pSO->nExpr;
   818    818         r1 = sqlite3GetTempReg(pParse);
   819    819         r2 = sqlite3GetTempRange(pParse, nKey+2);
   820    820         r3 = r2+nKey+1;
   821         -      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nResultCol, r3);
   822    821         if( eDest==SRT_DistQueue ){
   823    822           /* If the destination is DistQueue, then cursor (iParm+1) is open
   824    823           ** on a second ephemeral index that holds all values every previously
   825         -        ** added to the queue.  Only add this new value if it has never before
   826         -        ** been added */
   827         -        addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, r3, 0);
          824  +        ** added to the queue. */
          825  +        addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, 
          826  +                                        regResult, nResultCol);
   828    827           VdbeCoverage(v);
          828  +      }
          829  +      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nResultCol, r3);
          830  +      if( eDest==SRT_DistQueue ){
   829    831           sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm+1, r3);
   830    832           sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
   831    833         }
   832    834         for(i=0; i<nKey; i++){
   833    835           sqlite3VdbeAddOp2(v, OP_SCopy,
   834    836                             regResult + pSO->a[i].u.x.iOrderByCol - 1,
   835    837                             r2+i);

Changes to src/shell.c.

  1889   1889     }else{
  1890   1890       while( c!=EOF && c!=cSep && c!='\n' ){
  1891   1891         csv_append_char(p, c);
  1892   1892         c = fgetc(p->in);
  1893   1893       }
  1894   1894       if( c=='\n' ){
  1895   1895         p->nLine++;
  1896         -      if( p->n>1 && p->z[p->n-1]=='\r' ) p->n--;
         1896  +      if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--;
  1897   1897       }
  1898   1898       p->cTerm = c;
  1899   1899     }
  1900   1900     if( p->z ) p->z[p->n] = 0;
  1901   1901     return p->z;
  1902   1902   }
  1903   1903   

Changes to src/sqliteInt.h.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Internal interface definitions for SQLite.
    13     13   **
    14     14   */
    15         -#include "sqlite3.h"
    16     15   #ifndef _SQLITEINT_H_
    17     16   #define _SQLITEINT_H_
    18     17   
    19     18   /*
    20     19   ** These #defines should enable >2GB file support on POSIX if the
    21     20   ** underlying operating system supports it.  If the OS lacks
    22     21   ** large file support, or if the OS is windows, these should be no-ops.
................................................................................
    43     42   #ifndef SQLITE_DISABLE_LFS
    44     43   # define _LARGE_FILE       1
    45     44   # ifndef _FILE_OFFSET_BITS
    46     45   #   define _FILE_OFFSET_BITS 64
    47     46   # endif
    48     47   # define _LARGEFILE_SOURCE 1
    49     48   #endif
           49  +
           50  +/* The public SQLite interface.  The _FILE_OFFSET_BITS macro must appear
           51  +** first in QNX.
           52  +*/
           53  +#include "sqlite3.h"
    50     54   
    51     55   /*
    52     56   ** Include the configuration header output by 'configure' if we're using the
    53     57   ** autoconf-based build
    54     58   */
    55     59   #ifdef _HAVE_SQLITE_CONFIG_H
    56     60   #include "config.h"
................................................................................
  1310   1314   ** affinity value. 
  1311   1315   */
  1312   1316   #define SQLITE_AFF_MASK     0x67
  1313   1317   
  1314   1318   /*
  1315   1319   ** Additional bit values that can be ORed with an affinity without
  1316   1320   ** changing the affinity.
         1321  +**
         1322  +** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL.
         1323  +** It causes an assert() to fire if either operand to a comparison
         1324  +** operator is NULL.  It is added to certain comparison operators to
         1325  +** prove that the operands are always NOT NULL.
  1317   1326   */
  1318   1327   #define SQLITE_JUMPIFNULL   0x08  /* jumps if either operand is NULL */
  1319   1328   #define SQLITE_STOREP2      0x10  /* Store result in reg[P2] rather than jump */
  1320   1329   #define SQLITE_NULLEQ       0x80  /* NULL=NULL */
         1330  +#define SQLITE_NOTNULL      0x88  /* Assert that operands are never NULL */
  1321   1331   
  1322   1332   /*
  1323   1333   ** An object of this type is created for each virtual table present in
  1324   1334   ** the database schema. 
  1325   1335   **
  1326   1336   ** If the database schema is shared, then there is one instance of this
  1327   1337   ** structure for each database connection (sqlite3*) that uses the shared
................................................................................
  2344   2354     char *zErrMsg;       /* An error message */
  2345   2355     Vdbe *pVdbe;         /* An engine for executing database bytecode */
  2346   2356     int rc;              /* Return code from execution */
  2347   2357     u8 colNamesSet;      /* TRUE after OP_ColumnName has been issued to pVdbe */
  2348   2358     u8 checkSchema;      /* Causes schema cookie check after an error */
  2349   2359     u8 nested;           /* Number of nested calls to the parser/code generator */
  2350   2360     u8 nTempReg;         /* Number of temporary registers in aTempReg[] */
  2351         -  u8 nTempInUse;       /* Number of aTempReg[] currently checked out */
  2352   2361     u8 nColCache;        /* Number of entries in aColCache[] */
  2353   2362     u8 iColCache;        /* Next entry in aColCache[] to replace */
  2354   2363     u8 isMultiWrite;     /* True if statement may modify/insert multiple rows */
  2355   2364     u8 mayAbort;         /* True if statement may throw an ABORT exception */
  2356   2365     u8 hasCompound;      /* Need to invoke convertCompoundSelectToSubquery() */
  2357   2366     u8 okConstFactor;    /* OK to factor out constants */
  2358   2367     int aTempReg[8];     /* Holding area for temporary registers */

Changes to src/test_loadext.c.

    87     87       sqlite3_result_int(context, cur);
    88     88     }
    89     89   }
    90     90   
    91     91   /*
    92     92   ** Extension load function.
    93     93   */
           94  +#ifdef _WIN32
           95  +__declspec(dllexport)
           96  +#endif
    94     97   int testloadext_init(
    95     98     sqlite3 *db, 
    96     99     char **pzErrMsg, 
    97    100     const sqlite3_api_routines *pApi
    98    101   ){
    99    102     int nErr = 0;
   100    103     SQLITE_EXTENSION_INIT2(pApi);
................................................................................
   105    108                             statusFunc, 0, 0);
   106    109     return nErr ? SQLITE_ERROR : SQLITE_OK;
   107    110   }
   108    111   
   109    112   /*
   110    113   ** Another extension entry point. This one always fails.
   111    114   */
          115  +#ifdef _WIN32
          116  +__declspec(dllexport)
          117  +#endif
   112    118   int testbrokenext_init(
   113    119     sqlite3 *db, 
   114    120     char **pzErrMsg, 
   115    121     const sqlite3_api_routines *pApi
   116    122   ){
   117    123     char *zErr;
   118    124     SQLITE_EXTENSION_INIT2(pApi);
   119    125     zErr = sqlite3_mprintf("broken!");
   120    126     *pzErrMsg = zErr;
   121    127     return 1;
   122    128   }

Changes to src/update.c.

   430    430     }
   431    431   
   432    432     /* Top of the update loop */
   433    433     if( okOnePass ){
   434    434       if( aToOpen[iDataCur-iBaseCur] ){
   435    435         assert( pPk!=0 );
   436    436         sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey, nKey);
   437         -      VdbeCoverage(v);
          437  +      VdbeCoverageNeverTaken(v);
   438    438       }
   439    439       labelContinue = labelBreak;
   440    440       sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
   441    441       VdbeCoverage(v);
   442    442     }else if( pPk ){
   443    443       labelContinue = sqlite3VdbeMakeLabel(v);
   444    444       sqlite3VdbeAddOp2(v, OP_Rewind, iEph, labelBreak); VdbeCoverage(v);
................................................................................
   573    573         sqlite3FkCheck(pParse, pTab, regOldRowid, 0, aXRef, chngKey);
   574    574       }
   575    575   
   576    576       /* Delete the index entries associated with the current record.  */
   577    577       if( bReplace || chngKey ){
   578    578         if( pPk ){
   579    579           j1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey);
   580         -        VdbeCoverage(v);
   581    580         }else{
   582    581           j1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid);
   583         -        VdbeCoverage(v);
   584    582         }
          583  +      VdbeCoverageNeverTaken(v);
   585    584       }
   586    585       sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, aRegIdx);
   587    586     
   588    587       /* If changing the record number, delete the old record.  */
   589    588       if( hasFK || chngKey || pPk!=0 ){
   590    589         sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0);
   591    590       }

Changes to src/vdbe.c.

   104    104   #if defined(SQLITE_TEST) && !defined(SQLITE_OMIT_BUILTIN_TEST)
   105    105   # define UPDATE_MAX_BLOBSIZE(P)  updateMaxBlobsize(P)
   106    106   #else
   107    107   # define UPDATE_MAX_BLOBSIZE(P)
   108    108   #endif
   109    109   
   110    110   /*
   111         -** Invoke the VDBE coverage callback, if defined
          111  +** Invoke the VDBE coverage callback, if that callback is defined.  This
          112  +** feature is used for test suite validation only and does not appear an
          113  +** production builds.
          114  +**
          115  +** M is an integer, 2 or 3, that indices how many different ways the
          116  +** branch can go.  It is usually 2.  "I" is the direction the branch
          117  +** goes.  0 means falls through.  1 means branch is taken.  2 means the
          118  +** second alternative branch is taken.
   112    119   */
   113    120   #if !defined(SQLITE_VDBE_COVERAGE)
   114    121   # define VdbeBranchTaken(I,M)
   115    122   #else
   116         -# define VdbeBranchTaken(I,M) \
   117         -    if( sqlite3GlobalConfig.xVdbeBranch!=0 ){ \
   118         -      sqlite3GlobalConfig.xVdbeBranch(sqlite3GlobalConfig.pVdbeBranchArg, \
   119         -                                      pOp->iSrcLine,(I),(M)); }
          123  +# define VdbeBranchTaken(I,M) vdbeTakeBranch(pOp->iSrcLine,I,M)
          124  +  static void vdbeTakeBranch(int iSrcLine, u8 I, u8 M){
          125  +    if( iSrcLine<=2 && ALWAYS(iSrcLine>0) ){
          126  +      M = iSrcLine;
          127  +      /* Assert the truth of VdbeCoverageAlwaysTaken() and 
          128  +      ** VdbeCoverageNeverTaken() */
          129  +      assert( (M & I)==I );
          130  +    }else{
          131  +      if( sqlite3GlobalConfig.xVdbeBranch==0 ) return;  /*NO_TEST*/
          132  +      sqlite3GlobalConfig.xVdbeBranch(sqlite3GlobalConfig.pVdbeBranchArg,
          133  +                                      iSrcLine,I,M);
          134  +    }
          135  +  }
   120    136   #endif
   121    137   
   122    138   /*
   123    139   ** Convert the given register into a string if it isn't one
   124    140   ** already. Return non-zero if a malloc() fails.
   125    141   */
   126    142   #define Stringify(P, enc) \
................................................................................
   472    488     Mem *pIn2 = 0;             /* 2nd input operand */
   473    489     Mem *pIn3 = 0;             /* 3rd input operand */
   474    490     Mem *pOut = 0;             /* Output operand */
   475    491     int *aPermute = 0;         /* Permutation of columns for OP_Compare */
   476    492     i64 lastRowid = db->lastRowid;  /* Saved value of the last insert ROWID */
   477    493   #ifdef VDBE_PROFILE
   478    494     u64 start;                 /* CPU clock count at start of opcode */
   479         -  int origPc;                /* Program counter at start of opcode */
   480    495   #endif
   481    496     /*** INSERT STACK UNION HERE ***/
   482    497   
   483    498     assert( p->magic==VDBE_MAGIC_RUN );  /* sqlite3_step() verifies this */
   484    499     sqlite3VdbeEnter(p);
   485    500     if( p->rc==SQLITE_NOMEM ){
   486    501       /* This happens if a malloc() inside a call to sqlite3_column_text() or
................................................................................
   534    549     }
   535    550     sqlite3EndBenignMalloc();
   536    551   #endif
   537    552     for(pc=p->pc; rc==SQLITE_OK; pc++){
   538    553       assert( pc>=0 && pc<p->nOp );
   539    554       if( db->mallocFailed ) goto no_mem;
   540    555   #ifdef VDBE_PROFILE
   541         -    origPc = pc;
   542    556       start = sqlite3Hwtime();
   543    557   #endif
   544    558       nVmStep++;
   545    559       pOp = &aOp[pc];
   546    560   
   547    561       /* Only allow tracing if SQLITE_DEBUG is defined.
   548    562       */
................................................................................
  1155   1169   
  1156   1170   /* Opcode: ResultRow P1 P2 * * *
  1157   1171   ** Synopsis:  output=r[P1@P2]
  1158   1172   **
  1159   1173   ** The registers P1 through P1+P2-1 contain a single row of
  1160   1174   ** results. This opcode causes the sqlite3_step() call to terminate
  1161   1175   ** with an SQLITE_ROW return code and it sets up the sqlite3_stmt
  1162         -** structure to provide access to the r[P1]..r[P1+P2-1] values as
         1176  +** structure to provide access to the r(P1)..r(P1+P2-1) values as
  1163   1177   ** the result row.
  1164   1178   */
  1165   1179   case OP_ResultRow: {
  1166   1180     Mem *pMem;
  1167   1181     int i;
  1168   1182     assert( p->nResColumn==pOp->p2 );
  1169   1183     assert( pOp->p1>0 );
................................................................................
  1887   1901       if( pOp->p5 & SQLITE_NULLEQ ){
  1888   1902         /* If SQLITE_NULLEQ is set (which will only happen if the operator is
  1889   1903         ** OP_Eq or OP_Ne) then take the jump or not depending on whether
  1890   1904         ** or not both operands are null.
  1891   1905         */
  1892   1906         assert( pOp->opcode==OP_Eq || pOp->opcode==OP_Ne );
  1893   1907         assert( (flags1 & MEM_Cleared)==0 );
         1908  +      assert( (pOp->p5 & SQLITE_JUMPIFNULL)==0 );
  1894   1909         if( (flags1&MEM_Null)!=0
  1895   1910          && (flags3&MEM_Null)!=0
  1896   1911          && (flags3&MEM_Cleared)==0
  1897   1912         ){
  1898   1913           res = 0;  /* Results are equal */
  1899   1914         }else{
  1900   1915           res = 1;  /* Results are not equal */
................................................................................
  1905   1920         ** The jump is taken if the SQLITE_JUMPIFNULL bit is set.
  1906   1921         */
  1907   1922         if( pOp->p5 & SQLITE_STOREP2 ){
  1908   1923           pOut = &aMem[pOp->p2];
  1909   1924           MemSetTypeFlag(pOut, MEM_Null);
  1910   1925           REGISTER_TRACE(pOp->p2, pOut);
  1911   1926         }else{
  1912         -        VdbeBranchTaken((pOp->p5 & SQLITE_JUMPIFNULL)?2:3,4);
         1927  +        VdbeBranchTaken(2,3);
  1913   1928           if( pOp->p5 & SQLITE_JUMPIFNULL ){
  1914   1929             pc = pOp->p2-1;
  1915   1930           }
  1916   1931         }
  1917   1932         break;
  1918   1933       }
  1919   1934     }else{
................................................................................
  1942   1957     if( pOp->p5 & SQLITE_STOREP2 ){
  1943   1958       pOut = &aMem[pOp->p2];
  1944   1959       memAboutToChange(p, pOut);
  1945   1960       MemSetTypeFlag(pOut, MEM_Int);
  1946   1961       pOut->u.i = res;
  1947   1962       REGISTER_TRACE(pOp->p2, pOut);
  1948   1963     }else{
  1949         -    VdbeBranchTaken(res!=0, 4);
         1964  +    VdbeBranchTaken(res!=0, (pOp->p5 & SQLITE_NULLEQ)?2:3);
  1950   1965       if( res ){
  1951   1966         pc = pOp->p2-1;
  1952   1967       }
  1953   1968     }
  1954   1969     /* Undo any changes made by applyAffinity() to the input registers. */
  1955   1970     pIn1->flags = (pIn1->flags&~MEM_TypeMask) | (flags1&MEM_TypeMask);
  1956   1971     pIn3->flags = (pIn3->flags&~MEM_TypeMask) | (flags3&MEM_TypeMask);
................................................................................
  4829   4844   ** See also: Destroy
  4830   4845   */
  4831   4846   case OP_Clear: {
  4832   4847     int nChange;
  4833   4848    
  4834   4849     nChange = 0;
  4835   4850     assert( p->readOnly==0 );
  4836         -  assert( pOp->p1!=1 );
  4837   4851     assert( (p->btreeMask & (((yDbMask)1)<<pOp->p2))!=0 );
  4838   4852     rc = sqlite3BtreeClearTable(
  4839   4853         db->aDb[pOp->p2].pBt, pOp->p1, (pOp->p3 ? &nChange : 0)
  4840   4854     );
  4841   4855     if( pOp->p3 ){
  4842   4856       p->nChange += nChange;
  4843   4857       if( pOp->p3>0 ){
................................................................................
  6255   6269       }
  6256   6270   
  6257   6271   #ifdef VDBE_PROFILE
  6258   6272       {
  6259   6273         u64 elapsed = sqlite3Hwtime() - start;
  6260   6274         pOp->cycles += elapsed;
  6261   6275         pOp->cnt++;
  6262         -#if 0
  6263         -        fprintf(stdout, "%10llu ", elapsed);
  6264         -        sqlite3VdbePrintOp(stdout, origPc, &aOp[origPc]);
  6265         -#endif
  6266   6276       }
  6267   6277   #endif
  6268   6278   
  6269   6279       /* The following code adds nothing to the actual functionality
  6270   6280       ** of the program.  It is only here for testing and debugging.
  6271   6281       ** On the other hand, it does burn CPU cycles every time through
  6272   6282       ** the evaluator loop.  So we can leave it out when NDEBUG is defined.

Changes to src/vdbe.h.

    61     61       SubProgram *pProgram;  /* Used when p4type is P4_SUBPROGRAM */
    62     62       int (*xAdvance)(BtCursor *, int *);
    63     63     } p4;
    64     64   #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
    65     65     char *zComment;          /* Comment to improve readability */
    66     66   #endif
    67     67   #ifdef VDBE_PROFILE
    68         -  int cnt;                 /* Number of times this instruction was executed */
           68  +  u32 cnt;                 /* Number of times this instruction was executed */
    69     69     u64 cycles;              /* Total time spent executing this instruction */
    70     70   #endif
    71     71   #ifdef SQLITE_VDBE_COVERAGE
    72     72     int iSrcLine;            /* Source-code line that generated this opcode */
    73     73   #endif
    74     74   };
    75     75   typedef struct VdbeOp VdbeOp;
................................................................................
   237    237   # endif
   238    238   #else
   239    239   # define VdbeComment(X)
   240    240   # define VdbeNoopComment(X)
   241    241   # define VdbeModuleComment(X)
   242    242   #endif
   243    243   
   244         -/* Set the Opcode.iSrcline field of the previous opcode */
          244  +/*
          245  +** The VdbeCoverage macros are used to set a coverage testing point
          246  +** for VDBE branch instructions.  The coverage testing points are line
          247  +** numbers in the sqlite3.c source file.  VDBE branch coverage testing
          248  +** only works with an amalagmation build.  That's ok since a VDBE branch
          249  +** coverage build designed for testing the test suite only.  No application
          250  +** should ever ship with VDBE branch coverage measuring turned on.
          251  +**
          252  +**    VdbeCoverage(v)                  // Mark the previously coded instruction
          253  +**                                     // as a branch
          254  +**
          255  +**    VdbeCoverageIf(v, conditional)   // Mark previous if conditional true
          256  +**
          257  +**    VdbeCoverageAlwaysTaken(v)       // Previous branch is always taken
          258  +**
          259  +**    VdbeCoverageNeverTaken(v)        // Previous branch is never taken
          260  +**
          261  +** Every VDBE branch operation must be tagged with one of the macros above.
          262  +** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and
          263  +** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch()
          264  +** routine in vdbe.c, alerting the developer to the missed tag.
          265  +*/
   245    266   #ifdef SQLITE_VDBE_COVERAGE
   246    267     void sqlite3VdbeSetLineNumber(Vdbe*,int);
   247    268   # define VdbeCoverage(v) sqlite3VdbeSetLineNumber(v,__LINE__)
   248    269   # define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__)
          270  +# define VdbeCoverageAlwaysTaken(v) sqlite3VdbeSetLineNumber(v,2);
          271  +# define VdbeCoverageNeverTaken(v) sqlite3VdbeSetLineNumber(v,1);
   249    272   #else
   250    273   # define VdbeCoverage(v)
   251    274   # define VdbeCoverageIf(v,x)
          275  +# define VdbeCoverageAlwaysTaken(v)
          276  +# define VdbeCoverageNeverTaken(v)
   252    277   #endif
   253    278   
   254    279   #endif

Changes to src/vdbeaux.c.

  2576   2576             if( pc=='\n' ) fprintf(out, "-- ");
  2577   2577             putc(c, out);
  2578   2578             pc = c;
  2579   2579           }
  2580   2580           if( pc!='\n' ) fprintf(out, "\n");
  2581   2581         }
  2582   2582         for(i=0; i<p->nOp; i++){
  2583         -        fprintf(out, "%6d %10lld %8lld ",
         2583  +        char zHdr[100];
         2584  +        sqlite3_snprintf(sizeof(zHdr), zHdr, "%6u %12llu %8llu ",
  2584   2585              p->aOp[i].cnt,
  2585   2586              p->aOp[i].cycles,
  2586   2587              p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0
  2587   2588           );
         2589  +        fprintf(out, "%s", zHdr);
  2588   2590           sqlite3VdbePrintOp(out, i, &p->aOp[i]);
  2589   2591         }
  2590   2592         fclose(out);
  2591   2593       }
  2592   2594     }
  2593   2595   #endif
  2594   2596     p->iCurrentTime = 0;

Changes to src/where.c.

  2849   2849     ){
  2850   2850       /* Case 2:  We can directly reference a single row using an
  2851   2851       **          equality comparison against the ROWID field.  Or
  2852   2852       **          we reference multiple rows using a "rowid IN (...)"
  2853   2853       **          construct.
  2854   2854       */
  2855   2855       assert( pLoop->u.btree.nEq==1 );
  2856         -    iReleaseReg = sqlite3GetTempReg(pParse);
  2857   2856       pTerm = pLoop->aLTerm[0];
  2858   2857       assert( pTerm!=0 );
  2859   2858       assert( pTerm->pExpr!=0 );
  2860   2859       assert( omitTable==0 );
  2861   2860       testcase( pTerm->wtFlags & TERM_VIRTUAL );
         2861  +    iReleaseReg = ++pParse->nMem;
  2862   2862       iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg);
         2863  +    if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
  2863   2864       addrNxt = pLevel->addrNxt;
  2864   2865       sqlite3VdbeAddOp2(v, OP_MustBeInt, iRowidReg, addrNxt); VdbeCoverage(v);
  2865   2866       sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addrNxt, iRowidReg);
  2866   2867       VdbeCoverage(v);
  2867   2868       sqlite3ExprCacheAffinityChange(pParse, iRowidReg, 1);
  2868   2869       sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg);
  2869   2870       VdbeComment((v, "pk"));
................................................................................
  2944   2945       }
  2945   2946       start = sqlite3VdbeCurrentAddr(v);
  2946   2947       pLevel->op = bRev ? OP_Prev : OP_Next;
  2947   2948       pLevel->p1 = iCur;
  2948   2949       pLevel->p2 = start;
  2949   2950       assert( pLevel->p5==0 );
  2950   2951       if( testOp!=OP_Noop ){
  2951         -      iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse);
         2952  +      iRowidReg = ++pParse->nMem;
  2952   2953         sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg);
  2953   2954         sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg);
  2954   2955         sqlite3VdbeAddOp3(v, testOp, memEndValue, addrBrk, iRowidReg);
  2955   2956         VdbeCoverageIf(v, testOp==OP_Le);
  2956   2957         VdbeCoverageIf(v, testOp==OP_Lt);
  2957   2958         VdbeCoverageIf(v, testOp==OP_Ge);
  2958   2959         VdbeCoverageIf(v, testOp==OP_Gt);
................................................................................
  3177   3178   
  3178   3179       /* Seek the table cursor, if required */
  3179   3180       disableTerm(pLevel, pRangeStart);
  3180   3181       disableTerm(pLevel, pRangeEnd);
  3181   3182       if( omitTable ){
  3182   3183         /* pIdx is a covering index.  No need to access the main table. */
  3183   3184       }else if( HasRowid(pIdx->pTable) ){
  3184         -      iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse);
         3185  +      iRowidReg = ++pParse->nMem;
  3185   3186         sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, iRowidReg);
  3186   3187         sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg);
  3187   3188         sqlite3VdbeAddOp2(v, OP_Seek, iCur, iRowidReg);  /* Deferred seek */
  3188   3189       }else{
  3189   3190         Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
  3190   3191         iRowidReg = sqlite3GetTempRange(pParse, pPk->nKeyCol);
  3191   3192         for(j=0; j<pPk->nKeyCol; j++){
................................................................................
  3525   3526           continue;
  3526   3527         }
  3527   3528         assert( pTerm->pExpr );
  3528   3529         sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL);
  3529   3530         pTerm->wtFlags |= TERM_CODED;
  3530   3531       }
  3531   3532     }
  3532         -  sqlite3ReleaseTempReg(pParse, iReleaseReg);
  3533   3533   
  3534   3534     return pLevel->notReady;
  3535   3535   }
  3536   3536   
  3537   3537   #if defined(WHERETRACE_ENABLED) && defined(SQLITE_ENABLE_TREE_EXPLAIN)
  3538   3538   /*
  3539   3539   ** Generate "Explanation" text for a WhereTerm.
................................................................................
  4897   4897       } /* end-if not one-row */
  4898   4898   
  4899   4899       /* Mark off any other ORDER BY terms that reference pLoop */
  4900   4900       if( isOrderDistinct ){
  4901   4901         orderDistinctMask |= pLoop->maskSelf;
  4902   4902         for(i=0; i<nOrderBy; i++){
  4903   4903           Expr *p;
         4904  +        Bitmask mTerm;
  4904   4905           if( MASKBIT(i) & obSat ) continue;
  4905   4906           p = pOrderBy->a[i].pExpr;
  4906         -        if( (exprTableUsage(&pWInfo->sMaskSet, p)&~orderDistinctMask)==0 ){
         4907  +        mTerm = exprTableUsage(&pWInfo->sMaskSet,p);
         4908  +        if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue;
         4909  +        if( (mTerm&~orderDistinctMask)==0 ){
  4907   4910             obSat |= MASKBIT(i);
  4908   4911           }
  4909   4912         }
  4910   4913       }
  4911   4914     } /* End the loop over all WhereLoops from outer-most down to inner-most */
  4912   4915     if( obSat==obDone ) return 1;
  4913   4916     if( !isOrderDistinct ) return 0;
................................................................................
  5522   5525     ** and work forward so that the added virtual terms are never processed.
  5523   5526     */
  5524   5527     exprAnalyzeAll(pTabList, &pWInfo->sWC);
  5525   5528     if( db->mallocFailed ){
  5526   5529       goto whereBeginError;
  5527   5530     }
  5528   5531   
  5529         -  /* If the ORDER BY (or GROUP BY) clause contains references to general
  5530         -  ** expressions, then we won't be able to satisfy it using indices, so
  5531         -  ** go ahead and disable it now.
  5532         -  */
  5533         -  if( pOrderBy && (wctrlFlags & WHERE_WANT_DISTINCT)!=0 ){
  5534         -    for(ii=0; ii<pOrderBy->nExpr; ii++){
  5535         -      Expr *pExpr = sqlite3ExprSkipCollate(pOrderBy->a[ii].pExpr);
  5536         -      if( pExpr->op!=TK_COLUMN ){
  5537         -        pWInfo->pOrderBy = pOrderBy = 0;
  5538         -        break;
  5539         -      }else if( pExpr->iColumn<0 ){
  5540         -        break;
  5541         -      }
  5542         -    }
  5543         -  }
  5544         -
  5545   5532     if( wctrlFlags & WHERE_WANT_DISTINCT ){
  5546   5533       if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
  5547   5534         /* The DISTINCT marking is pointless.  Ignore it. */
  5548   5535         pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
  5549   5536       }else if( pOrderBy==0 ){
  5550   5537         /* Try to ORDER BY the result set to make distinct processing easier */
  5551   5538         pWInfo->wctrlFlags |= WHERE_DISTINCTBY;

Changes to test/loadext.test.

    61     61   set dlerror_nosymbol   {%s: undefined symbol: %s}
    62     62   
    63     63   if {$::tcl_platform(os) eq "Darwin"} {
    64     64     set dlerror_nosuchfile {dlopen(%s, 10): image not found}
    65     65     set dlerror_notadll    {dlopen(%1$s, 10): no suitable image found.*}
    66     66     set dlerror_nosymbol   {dlsym(XXX, %2$s): symbol not found}
    67     67   }
           68  +
           69  +if {$::tcl_platform(platform) eq "windows"} {
           70  +  set dlerror_nosuchfile {The specified module could not be found.*}
           71  +  set dlerror_notadll    {%%1 is not a valid Win32 application.*}
           72  +  set dlerror_nosymbol   {The specified procedure could not be found.*}
           73  +}
    68     74   
    69     75   # Make sure the test extension actually exists.  If it does not
    70     76   # exist, try to create it.  If unable to create it, then skip this
    71     77   # test file.
    72     78   #
    73     79   if {![file exists $testextension]} {
    74     80     set srcdir [file dir $testdir]/src
................................................................................
   163    169     set rc [catch {
   164    170       sqlite3_load_extension db $testextension icecream
   165    171     } msg]
   166    172     if {$::tcl_platform(os) eq "Darwin"} {
   167    173       regsub {0x[1234567890abcdefABCDEF]*} $msg XXX msg
   168    174     }
   169    175     list $rc $msg
   170         -} [list 1 [format $dlerror_nosymbol $testextension icecream]]
          176  +} /[list 1 [format $dlerror_nosymbol $testextension icecream]]/
   171    177   
   172    178   # Try to load an extension for which the entry point fails (returns non-zero) 
   173    179   #
   174    180   do_test loadext-2.4 {
   175    181     set rc [catch {
   176    182       sqlite3_load_extension db $testextension testbrokenext_init
   177    183     } msg]
................................................................................
   263    269   # Malloc failure in sqlite3_auto_extension and sqlite3_load_extension
   264    270   #
   265    271   do_malloc_test loadext-5 -tclprep {
   266    272     sqlite3_reset_auto_extension
   267    273   } -tclbody {
   268    274     if {[autoinstall_test_functions]==7} {error "out of memory"}
   269    275   }
   270         -do_malloc_test loadext-6 -tclbody {
   271         -  db enable_load_extension 1
   272         -  sqlite3_load_extension db $::testextension testloadext_init
          276  +
          277  +# On Windows, this malloc test must be skipped because the winDlOpen
          278  +# function itself can fail due to "out of memory" conditions.
          279  +#
          280  +if {$::tcl_platform(platform) ne "windows"} {
          281  +  do_malloc_test loadext-6 -tclbody {
          282  +    db enable_load_extension 1
          283  +    sqlite3_load_extension db $::testextension testloadext_init
          284  +  }
   273    285   }
          286  +
   274    287   autoinstall_test_functions
   275    288   
   276    289   finish_test

Changes to test/select4.test.

   819    819       INSERT INTO t13 VALUES(2,2);
   820    820       INSERT INTO t13 VALUES(3,2);
   821    821       INSERT INTO t13 VALUES(4,2);
   822    822       CREATE INDEX t13ab ON t13(a,b);
   823    823       SELECT DISTINCT b from t13 WHERE a IN (1,2,3);
   824    824     }
   825    825   } {1 2}
          826  +
          827  +# 2014-02-18: Make sure compound SELECTs work with VALUES clauses
          828  +#
          829  +do_execsql_test select4-14.1 {
          830  +  CREATE TABLE t14(a,b,c);
          831  +  INSERT INTO t14 VALUES(1,2,3),(4,5,6);
          832  +  SELECT * FROM t14 INTERSECT VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3);
          833  +} {1 2 3}
          834  +do_execsql_test select4-14.2 {
          835  +  SELECT * FROM t14 INTERSECT VALUES(1,2,3);
          836  +} {1 2 3}
          837  +do_execsql_test select4-14.3 {
          838  +  SELECT * FROM t14
          839  +   UNION VALUES(3,2,1),(2,3,1),(1,2,3),(7,8,9),(4,5,6)
          840  +   UNION SELECT * FROM t14 ORDER BY 1, 2, 3
          841  +} {1 2 3 2 3 1 3 2 1 4 5 6 7 8 9}
          842  +do_execsql_test select4-14.4 {
          843  +  SELECT * FROM t14
          844  +   UNION VALUES(3,2,1)
          845  +   UNION SELECT * FROM t14 ORDER BY 1, 2, 3
          846  +} {1 2 3 3 2 1 4 5 6}
          847  +do_execsql_test select4-14.5 {
          848  +  SELECT * FROM t14 EXCEPT VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3);
          849  +} {4 5 6}
          850  +do_execsql_test select4-14.6 {
          851  +  SELECT * FROM t14 EXCEPT VALUES(1,2,3)
          852  +} {4 5 6}
          853  +do_execsql_test select4-14.7 {
          854  +  SELECT * FROM t14 EXCEPT VALUES(1,2,3) EXCEPT VALUES(4,5,6)
          855  +} {}
          856  +do_execsql_test select4-14.8 {
          857  +  SELECT * FROM t14 EXCEPT VALUES('a','b','c') EXCEPT VALUES(4,5,6)
          858  +} {1 2 3}
          859  +do_execsql_test select4-14.9 {
          860  +  SELECT * FROM t14 UNION ALL VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3);
          861  +} {1 2 3 4 5 6 3 2 1 2 3 1 1 2 3 2 1 3}
   826    862   
   827    863   finish_test

Changes to test/shell5.test.

   280    280     catchcmd test.db {.mode csv
   281    281       CREATE TABLE t1(a,b,c,d);
   282    282   .import shell5.csv t1
   283    283     }
   284    284     sqlite3 db test.db
   285    285     db eval {SELECT hex(c) FROM t1 ORDER BY rowid}
   286    286   } {636F6C756D6E33 783320220D0A64617461222033 783320220A64617461222033}
          287  +
          288  +# Blank last column with \r\n line endings.
          289  +do_test shell5-1.11 {
          290  +  set out [open shell5.csv w]
          291  +  fconfigure $out -translation binary
          292  +  puts $out "column1,column2,column3\r"
          293  +  puts $out "a,b, \r"
          294  +  puts $out "x,y,\r"
          295  +  puts $out "p,q,r\r"
          296  +  close $out
          297  +  catch {db close}
          298  +  forcedelete test.db
          299  +  catchcmd test.db {.mode csv
          300  +.import shell5.csv t1
          301  +  }
          302  +  sqlite3 db test.db
          303  +  db eval {SELECT *, '|' FROM t1}
          304  +} {a b { } | x y {} | p q r |}
          305  +
   287    306   
   288    307   db close
   289    308   
   290    309   finish_test

Added test/tkt-8c63ff0ec.test.

            1  +# 2014-02-25
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# 
           12  +# Test cases to show that ticket [8c63ff0eca81a9132d8d67b31cd6ae9712a2cc6f]
           13  +# "Incorrect query result on a UNION ALL" which was caused by using the same
           14  +# temporary register in concurrent co-routines, as been fixed.
           15  +# 
           16  +
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +set ::testprefix tkt-8c63ff0ec
           21  +
           22  +do_execsql_test 1.1 {
           23  +  CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, d, e);
           24  +  INSERT INTO t1 VALUES(1,20,30,40,50),(3,60,70,80,90);
           25  +  CREATE TABLE t2(x INTEGER PRIMARY KEY);
           26  +  INSERT INTO t2 VALUES(2);
           27  +  CREATE TABLE t3(z);
           28  +  INSERT INTO t3 VALUES(2),(2),(2),(2);
           29  +  
           30  +  SELECT a, b+c FROM t1
           31  +  UNION ALL
           32  +  SELECT x, 5 FROM t2 JOIN t3 ON z=x WHERE x=2
           33  +  ORDER BY a;
           34  +} {1 50 2 5 2 5 2 5 2 5 3 130}
           35  +do_execsql_test 1.2 {
           36  +  SELECT a, b+c+d FROM t1
           37  +  UNION ALL
           38  +  SELECT x, 5 FROM t2 JOIN t3 ON z=x WHERE x=2
           39  +  ORDER BY a;
           40  +} {1 90 2 5 2 5 2 5 2 5 3 210}
           41  +do_execsql_test 1.3 {
           42  +  SELECT a, b+c+d+e FROM t1
           43  +  UNION ALL
           44  +  SELECT x, 5 FROM t2 JOIN t3 ON z=x WHERE x=2
           45  +  ORDER BY a;
           46  +} {1 140 2 5 2 5 2 5 2 5 3 300}
           47  +
           48  +finish_test

Changes to test/walro.test.

    28     28   #
    29     29   ifcapable !wal {
    30     30     finish_test
    31     31     return
    32     32   }
    33     33   
    34     34   do_multiclient_test tn {
    35         -  # Do not run tests with the connections in the same process.
    36         -  #
    37         -  if {$tn==2} continue
    38     35     
    39     36     # Close all connections and delete the database.
    40     37     #
    41     38     code1 { db close  }
    42     39     code2 { db2 close }
    43     40     code3 { db3 close }
    44     41     forcedelete test.db
    45     42     forcedelete walro
           43  +  
           44  +  # Do not run tests with the connections in the same process.
           45  +  #
           46  +  if {$tn==2} continue
    46     47   
    47     48     foreach c {code1 code2 code3} {
    48     49       $c {
    49     50         sqlite3_shutdown
    50     51         sqlite3_config_uri 1
    51     52       }
    52     53     }
................................................................................
   228    229   forcedelete test.db
   229    230   
   230    231   #-----------------------------------------------------------------------
   231    232   # Test cases 2.* check that a read-only connection may read the
   232    233   # database file while a checkpoint operation is ongoing.
   233    234   #
   234    235   do_multiclient_test tn {
   235         -  # Do not run tests with the connections in the same process.
   236         -  #
   237         -  if {$tn==2} continue
   238    236     
   239    237     # Close all connections and delete the database.
   240    238     #
   241    239     code1 { db close  }
   242    240     code2 { db2 close }
   243    241     code3 { db3 close }
   244    242     forcedelete test.db
   245    243     forcedelete walro
          244  +  
          245  +  # Do not run tests with the connections in the same process.
          246  +  #
          247  +  if {$tn==2} continue
   246    248   
   247    249     foreach c {code1 code2 code3} {
   248    250       $c {
   249    251         sqlite3_shutdown
   250    252         sqlite3_config_uri 1
   251    253       }
   252    254     }

Changes to test/where2.test.

   116    116     }
   117    117   } {85 6 7396 7402 sort t1 i1xy}
   118    118   do_test where2-2.3 {
   119    119     queryplan {
   120    120       SELECT * FROM t1 WHERE rowid=85 AND x=6 AND y=7396 ORDER BY random();
   121    121     }
   122    122   } {85 6 7396 7402 nosort t1 *}
          123  +
          124  +# Ticket [65bdeb9739605cc22966f49208452996ff29a640] 2014-02-26
          125  +# Make sure "ORDER BY random" does not gets optimized out.
          126  +#
          127  +do_test where2-2.4 {
          128  +  db eval {
          129  +    CREATE TABLE x1(a INTEGER PRIMARY KEY, b DEFAULT 1);
          130  +    WITH RECURSIVE
          131  +       cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<50)
          132  +    INSERT INTO x1 SELECT x, 1 FROM cnt;
          133  +    CREATE TABLE x2(x INTEGER PRIMARY KEY);
          134  +    INSERT INTO x2 VALUES(1);
          135  +  }
          136  +  set sql {SELECT * FROM x1, x2 WHERE x=1 ORDER BY random()}
          137  +  set out1 [db eval $sql]
          138  +  set out2 [db eval $sql]
          139  +  set out3 [db eval $sql]
          140  +  expr {$out1!=$out2 && $out2!=$out3}
          141  +} {1}
          142  +do_execsql_test where2-2.5 {
          143  +  -- random() is not optimized out
          144  +  EXPLAIN SELECT * FROM x1, x2 WHERE x=1 ORDER BY random();
          145  +} {/ random/}
          146  +do_execsql_test where2-2.5b {
          147  +  -- random() is not optimized out
          148  +  EXPLAIN SELECT * FROM x1, x2 WHERE x=1 ORDER BY random();
          149  +} {/ SorterOpen /}
          150  +do_execsql_test where2-2.6 {
          151  +  -- other constant functions are optimized out
          152  +  EXPLAIN SELECT * FROM x1, x2 WHERE x=1 ORDER BY abs(5);
          153  +} {~/ abs/}
          154  +do_execsql_test where2-2.6b {
          155  +  -- other constant functions are optimized out
          156  +  EXPLAIN SELECT * FROM x1, x2 WHERE x=1 ORDER BY abs(5);
          157  +} {~/ SorterOpen /}
          158  +
   123    159   
   124    160   
   125    161   # Efficient handling of forward and reverse table scans.
   126    162   #
   127    163   do_test where2-3.1 {
   128    164     queryplan {
   129    165       SELECT * FROM t1 ORDER BY rowid LIMIT 2

Changes to tool/mksqlite3c.tcl.

   117    117      vdbeInt.h
   118    118      wal.h
   119    119      whereInt.h
   120    120   } {
   121    121     set available_hdr($hdr) 1
   122    122   }
   123    123   set available_hdr(sqliteInt.h) 0
   124         -set available_hdr(sqlite3.h) 0
   125    124   
   126    125   # 78 stars used for comment formatting.
   127    126   set s78 \
   128    127   {*****************************************************************************}
   129    128   
   130    129   # Insert a comment into the code
   131    130   #
................................................................................
   225    224   
   226    225   
   227    226   # Process the source files.  Process files containing commonly
   228    227   # used subroutines first in order to help the compiler find
   229    228   # inlining opportunities.
   230    229   #
   231    230   foreach file {
   232         -   sqlite3.h
   233    231      sqliteInt.h
   234    232   
   235    233      global.c
   236    234      ctime.c
   237    235      status.c
   238    236      date.c
   239    237      os.c