/ Check-in [ceccc9ad]
Login

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

Overview
Comment:Merge trunk changes (including fixes for warnings in fts5) with this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts5-perf
Files: files | file ages | folders
SHA1: ceccc9ad788fb4da9120915741995b9f088f85ff
User & Date: dan 2016-01-23 16:20:16
Context
2016-01-23
18:51
Fix an fts5 problem with using both xPhraseFirst() and xPhraseFirstColumn() within a single statement in detail=col mode. check-in: 72d53699 user: dan tags: fts5-perf
16:20
Merge trunk changes (including fixes for warnings in fts5) with this branch. check-in: ceccc9ad user: dan tags: fts5-perf
15:57
Fix some signed/unsigned comparison compiler warnings in fts5. check-in: 3be336aa user: dan tags: trunk
14:45
Fix a problem involving detail=col and column filters. check-in: 7558a0ad user: dan tags: fts5-perf
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

  1321   1321   #
  1322   1322   TESTOPTS = --verbose=file --output=test-out.txt
  1323   1323   
  1324   1324   # This is the default Makefile target.  The objects listed here
  1325   1325   # are what get build when you type just "make" with no arguments.
  1326   1326   #
  1327   1327   all:	dll libsqlite3.lib shell libtclsqlite3.lib
         1328  +
         1329  +# Dynamic link library section.
         1330  +#
         1331  +dll: $(SQLITE3DLL)
         1332  +
         1333  +# Shell executable.
         1334  +#
         1335  +shell: $(SQLITE3EXE)
  1328   1336   
  1329   1337   libsqlite3.lib:	$(LIBOBJ)
  1330   1338   	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
  1331   1339   
  1332   1340   libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
  1333   1341   	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
         1342  +
         1343  +$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
         1344  +	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
         1345  +
         1346  +sqlite3.def: libsqlite3.lib
         1347  +	echo EXPORTS > sqlite3.def
         1348  +	dumpbin /all libsqlite3.lib \
         1349  +		| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" \1 \
         1350  +		| sort >> sqlite3.def
  1334   1351   
  1335   1352   $(SQLITE3EXE):	$(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
  1336   1353   	$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
  1337   1354   		/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1338   1355   
  1339   1356   sqldiff.exe:	$(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
  1340   1357   	$(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
................................................................................
  1415   1432   
  1416   1433   opcodes.lo:	opcodes.c
  1417   1434   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
  1418   1435   
  1419   1436   # Rule to build the Win32 resources object file.
  1420   1437   #
  1421   1438   !IF $(USE_RC)!=0
  1422         -$(LIBRESOBJS):	$(TOP)\src\sqlite3.rc $(HDR)
         1439  +$(LIBRESOBJS):	$(TOP)\src\sqlite3.rc $(SQLITE3H)
  1423   1440   	echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
  1424   1441   	for /F %%V in ('type "$(TOP)\VERSION"') do ( \
  1425   1442   		echo #define SQLITE_RESOURCE_VERSION %%V \
  1426   1443   			| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
  1427   1444   	)
  1428   1445   	echo #endif >> sqlite3rc.h
  1429   1446   	$(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
................................................................................
  1927   1944   
  1928   1945   rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
  1929   1946   	$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
  1930   1947   		$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1931   1948   
  1932   1949   clean:
  1933   1950   	del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
  1934         -	del /Q *.bsc *.cod *.da *.bb *.bbg gmon.out 2>NUL
         1951  +	del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
  1935   1952   	del /Q $(SQLITE3C) $(SQLITE3H) opcodes.c opcodes.h 2>NUL
  1936   1953   	del /Q lemon.* lempar.c parse.* 2>NUL
  1937   1954   	del /Q mkkeywordhash.* keywordhash.h 2>NUL
  1938   1955   	del /Q notasharedlib.* 2>NUL
  1939   1956   	-rmdir /Q/S .deps 2>NUL
  1940   1957   	-rmdir /Q/S .libs 2>NUL
  1941   1958   	-rmdir /Q/S quota2a 2>NUL
................................................................................
  1953   1970   	del /Q sqlite3.c sqlite3-*.c 2>NUL
  1954   1971   	del /Q sqlite3rc.h 2>NUL
  1955   1972   	del /Q shell.c sqlite3ext.h 2>NUL
  1956   1973   	del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
  1957   1974   	del /Q sqlite-*-output.vsix 2>NUL
  1958   1975   	del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe 2>NUL
  1959   1976   	del /Q fts5.* fts5parse.* 2>NUL
  1960         -
  1961         -# Shell executable.
  1962         -#
  1963         -shell: $(SQLITE3EXE)
  1964         -
  1965         -# Dynamic link library section.
  1966         -#
  1967         -dll: $(SQLITE3DLL)
  1968         -
  1969         -sqlite3.def: libsqlite3.lib
  1970         -	echo EXPORTS > sqlite3.def
  1971         -	dumpbin /all libsqlite3.lib \
  1972         -		| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" \1 \
  1973         -		| sort >> sqlite3.def
  1974         -
  1975         -$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
  1976         -	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)

Changes to ext/fts5/fts5Int.h.

   221    221   
   222    222   /*
   223    223   ** Buffer object for the incremental building of string data.
   224    224   */
   225    225   typedef struct Fts5Buffer Fts5Buffer;
   226    226   struct Fts5Buffer {
   227    227     u8 *p;
   228         -  u32 n;
   229         -  u32 nSpace;
          228  +  int n;
          229  +  int nSpace;
   230    230   };
   231    231   
   232    232   int sqlite3Fts5BufferSize(int*, Fts5Buffer*, u32);
   233    233   void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64);
   234    234   void sqlite3Fts5BufferAppendBlob(int*, Fts5Buffer*, u32, const u8*);
   235    235   void sqlite3Fts5BufferAppendString(int *, Fts5Buffer*, const char*);
   236    236   void sqlite3Fts5BufferFree(Fts5Buffer*);
................................................................................
   243    243   #define fts5BufferZero(x)             sqlite3Fts5BufferZero(x)
   244    244   #define fts5BufferAppendVarint(a,b,c) sqlite3Fts5BufferAppendVarint(a,b,c)
   245    245   #define fts5BufferFree(a)             sqlite3Fts5BufferFree(a)
   246    246   #define fts5BufferAppendBlob(a,b,c,d) sqlite3Fts5BufferAppendBlob(a,b,c,d)
   247    247   #define fts5BufferSet(a,b,c,d)        sqlite3Fts5BufferSet(a,b,c,d)
   248    248   
   249    249   #define fts5BufferGrow(pRc,pBuf,nn) ( \
   250         -  (pBuf)->n + (nn) <= (pBuf)->nSpace ? 0 : \
          250  +  (u32)((pBuf)->n) + (u32)(nn) <= (u32)((pBuf)->nSpace) ? 0 : \
   251    251       sqlite3Fts5BufferSize((pRc),(pBuf),(nn)+(pBuf)->n) \
   252    252   )
   253    253   
   254    254   /* Write and decode big-endian 32-bit integer values */
   255    255   void sqlite3Fts5Put32(u8*, int);
   256    256   int sqlite3Fts5Get32(const u8*);
   257    257   

Changes to ext/fts5/fts5_buffer.c.

   359    359     }
   360    360   
   361    361     return rc;
   362    362   }
   363    363   
   364    364   void sqlite3Fts5TermsetFree(Fts5Termset *p){
   365    365     if( p ){
   366         -    int i;
          366  +    u32 i;
   367    367       for(i=0; i<ArraySize(p->apHash); i++){
   368    368         Fts5TermsetEntry *pEntry = p->apHash[i];
   369    369         while( pEntry ){
   370    370           Fts5TermsetEntry *pDel = pEntry;
   371    371           pEntry = pEntry->pNext;
   372    372           sqlite3_free(pDel);
   373    373         }

Changes to src/os_unix.c.

  6183   6183       *piNow = 1000*(sqlite3_int64)sqlite3_current_time + unixEpoch;
  6184   6184     }
  6185   6185   #endif
  6186   6186     UNUSED_PARAMETER(NotUsed);
  6187   6187     return rc;
  6188   6188   }
  6189   6189   
  6190         -#if 0 /* Not used */
         6190  +#ifndef SQLITE_OMIT_DEPRECATED
  6191   6191   /*
  6192   6192   ** Find the current time (in Universal Coordinated Time).  Write the
  6193   6193   ** current time and date as a Julian Day number into *prNow and
  6194   6194   ** return 0.  Return 1 if the time and date cannot be found.
  6195   6195   */
  6196   6196   static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow){
  6197   6197     sqlite3_int64 i = 0;
................................................................................
  6201   6201     *prNow = i/86400000.0;
  6202   6202     return rc;
  6203   6203   }
  6204   6204   #else
  6205   6205   # define unixCurrentTime 0
  6206   6206   #endif
  6207   6207   
  6208         -#if 0  /* Not used */
         6208  +#ifndef SQLITE_OMIT_DEPRECATED
  6209   6209   /*
  6210   6210   ** We added the xGetLastError() method with the intention of providing
  6211   6211   ** better low-level error messages when operating-system problems come up
  6212   6212   ** during SQLite operation.  But so far, none of that has been implemented
  6213   6213   ** in the core.  So this routine is never called.  For now, it is merely
  6214   6214   ** a place-holder.
  6215   6215   */

Changes to src/prepare.c.

   521    521     pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
   522    522     if( pParse==0 ){
   523    523       rc = SQLITE_NOMEM;
   524    524       goto end_prepare;
   525    525     }
   526    526     pParse->pReprepare = pReprepare;
   527    527     assert( ppStmt && *ppStmt==0 );
   528         -  assert( !db->mallocFailed );
          528  +  /* assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA */
   529    529     assert( sqlite3_mutex_held(db->mutex) );
   530    530   
   531    531     /* Check to verify that it is possible to get a read lock on all
   532    532     ** database schemas.  The inability to get a read lock indicates that
   533    533     ** some other database connection is holding a write-lock, which in
   534    534     ** turn means that the other connection has made uncommitted changes
   535    535     ** to the schema.

Changes to src/sqlite3.rc.

    35     35   #pragma code_page(1252)
    36     36   #endif /* defined(_WIN32) */
    37     37   
    38     38   /*
    39     39    * Icon
    40     40    */
    41     41   
           42  +#if !defined(RC_VERONLY)
    42     43   #define IDI_SQLITE 101
    43     44   
    44     45   IDI_SQLITE ICON "..\\art\\sqlite370.ico"
           46  +#endif /* !defined(RC_VERONLY) */
    45     47   
    46     48   /*
    47     49    * Version
    48     50    */
    49     51   
    50     52   VS_VERSION_INFO VERSIONINFO
    51     53     FILEVERSION SQLITE_RESOURCE_VERSION

Changes to src/tclsqlite.c.

   149    149     SqlPreparedStmt *stmtList; /* List of prepared statements*/
   150    150     SqlPreparedStmt *stmtLast; /* Last statement in the list */
   151    151     int maxStmt;               /* The next maximum number of stmtList */
   152    152     int nStmt;                 /* Number of statements in stmtList */
   153    153     IncrblobChannel *pIncrblob;/* Linked list of open incrblob channels */
   154    154     int nStep, nSort, nIndex;  /* Statistics for most recent operation */
   155    155     int nTransaction;          /* Number of nested [transaction] methods */
          156  +  int openFlags;             /* Flags used to open.  (SQLITE_OPEN_URI) */
   156    157   #ifdef SQLITE_TEST
   157    158     int bLegacyPrepare;        /* True to use sqlite3_prepare() */
   158    159   #endif
   159    160   };
   160    161   
   161    162   struct IncrblobChannel {
   162    163     sqlite3_blob *pBlob;      /* sqlite3 blob handle */
................................................................................
  1746   1747       }else if( objc==4 ){
  1747   1748         zSrcDb = Tcl_GetString(objv[2]);
  1748   1749         zDestFile = Tcl_GetString(objv[3]);
  1749   1750       }else{
  1750   1751         Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME");
  1751   1752         return TCL_ERROR;
  1752   1753       }
  1753         -    rc = sqlite3_open(zDestFile, &pDest);
         1754  +    rc = sqlite3_open_v2(zDestFile, &pDest,
         1755  +               SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE| pDb->openFlags, 0);
  1754   1756       if( rc!=SQLITE_OK ){
  1755   1757         Tcl_AppendResult(interp, "cannot open target database: ",
  1756   1758              sqlite3_errmsg(pDest), (char*)0);
  1757   1759         sqlite3_close(pDest);
  1758   1760         return TCL_ERROR;
  1759   1761       }
  1760   1762       pBackup = sqlite3_backup_init(pDest, "main", pDb->db, zSrcDb);
................................................................................
  2609   2611       }else if( objc==4 ){
  2610   2612         zDestDb = Tcl_GetString(objv[2]);
  2611   2613         zSrcFile = Tcl_GetString(objv[3]);
  2612   2614       }else{
  2613   2615         Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME");
  2614   2616         return TCL_ERROR;
  2615   2617       }
  2616         -    rc = sqlite3_open_v2(zSrcFile, &pSrc, SQLITE_OPEN_READONLY, 0);
         2618  +    rc = sqlite3_open_v2(zSrcFile, &pSrc,
         2619  +                         SQLITE_OPEN_READONLY | pDb->openFlags, 0);
  2617   2620       if( rc!=SQLITE_OK ){
  2618   2621         Tcl_AppendResult(interp, "cannot open source database: ",
  2619   2622              sqlite3_errmsg(pSrc), (char*)0);
  2620   2623         sqlite3_close(pSrc);
  2621   2624         return TCL_ERROR;
  2622   2625       }
  2623   2626       pBackup = sqlite3_backup_init(pDb->db, zDestDb, pSrc, "main");
................................................................................
  3084   3087     if( p->db==0 ){
  3085   3088       Tcl_SetResult(interp, zErrMsg, TCL_VOLATILE);
  3086   3089       Tcl_Free((char*)p);
  3087   3090       sqlite3_free(zErrMsg);
  3088   3091       return TCL_ERROR;
  3089   3092     }
  3090   3093     p->maxStmt = NUM_PREPARED_STMTS;
         3094  +  p->openFlags = flags & SQLITE_OPEN_URI;
  3091   3095     p->interp = interp;
  3092   3096     zArg = Tcl_GetStringFromObj(objv[1], 0);
  3093   3097     if( DbUseNre() ){
  3094   3098       Tcl_NRCreateCommand(interp, zArg, DbObjCmdAdaptor, DbObjCmd,
  3095   3099                           (char*)p, DbDeleteCmd);
  3096   3100     }else{
  3097   3101       Tcl_CreateObjCommand(interp, zArg, DbObjCmd, (char*)p, DbDeleteCmd);