/ Check-in [c3cd543f]
Login

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

Overview
Comment:Merge all changes from the 3.14 release.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: c3cd543f3380475509d7bab9bb6c7858a8402457
User & Date: drh 2016-08-08 14:21:10
Context
2016-09-07
18:20
Merge recent enhancements from trunk. check-in: 00759af0 user: drh tags: apple-osx
2016-08-08
14:21
Merge all changes from the 3.14 release. check-in: c3cd543f user: drh tags: apple-osx
13:40
Version 3.14 check-in: d5e98057 user: drh tags: trunk, release, version-3.14.0
2016-08-04
13:39
Merge all recent enhancements from trunk. check-in: dacfff51 user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to autoconf/tea/configure.ac.

    74     74   TEA_ADD_SOURCES([tclsqlite3.c])
    75     75   TEA_ADD_HEADERS([])
    76     76   TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}/generic`\"])
    77     77   TEA_ADD_LIBS([])
    78     78   TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3=1])
    79     79   TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1])
    80     80   TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1])
    81         -TEA_ADD_CFLAGS([-DSQLITE_OMIT_DEPRECATED=1])
    82     81   TEA_ADD_STUB_SOURCES([])
    83     82   TEA_ADD_TCL_SOURCES([])
    84     83   
    85     84   #--------------------------------------------------------------------
    86     85   # The --with-system-sqlite causes the TCL bindings to SQLite to use
    87     86   # the system shared library for SQLite rather than statically linking
    88     87   # against its own private copy.  This is dangerous and leads to

Changes to ext/fts5/fts5.h.

   314    314   ** Applications may also register custom tokenizer types. A tokenizer 
   315    315   ** is registered by providing fts5 with a populated instance of the 
   316    316   ** following structure. All structure methods must be defined, setting
   317    317   ** any member of the fts5_tokenizer struct to NULL leads to undefined
   318    318   ** behaviour. The structure methods are expected to function as follows:
   319    319   **
   320    320   ** xCreate:
   321         -**   This function is used to allocate and inititalize a tokenizer instance.
          321  +**   This function is used to allocate and initialize a tokenizer instance.
   322    322   **   A tokenizer instance is required to actually tokenize text.
   323    323   **
   324    324   **   The first argument passed to this function is a copy of the (void*)
   325    325   **   pointer provided by the application when the fts5_tokenizer object
   326    326   **   was registered with FTS5 (the third argument to xCreateTokenizer()). 
   327    327   **   The second and third arguments are an array of nul-terminated strings
   328    328   **   containing the tokenizer arguments, if any, specified following the
................................................................................
   573    573   *************************************************************************/
   574    574   
   575    575   #ifdef __cplusplus
   576    576   }  /* end of the 'extern "C"' block */
   577    577   #endif
   578    578   
   579    579   #endif /* _FTS5_H */
   580         -

Changes to src/backup.c.

   773    773   #endif
   774    774   
   775    775     /* 0x7FFFFFFF is the hard limit for the number of pages in a database
   776    776     ** file. By passing this as the number of pages to copy to
   777    777     ** sqlite3_backup_step(), we can guarantee that the copy finishes 
   778    778     ** within a single call (unless an error occurs). The assert() statement
   779    779     ** checks this assumption - (p->rc) should be set to either SQLITE_DONE 
   780         -  ** or an error code.
   781         -  */
          780  +  ** or an error code.  */
   782    781     sqlite3_backup_step(&b, 0x7FFFFFFF);
   783    782     assert( b.rc!=SQLITE_OK );
          783  +
   784    784     rc = sqlite3_backup_finish(&b);
   785    785     if( rc==SQLITE_OK ){
   786    786       pTo->pBt->btsFlags &= ~BTS_PAGESIZE_FIXED;
          787  +  }else{
          788  +    sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
   787    789     }
   788    790   
   789    791     assert( sqlite3BtreeIsInTrans(pTo)==0 );
   790    792   copy_finished:
   791    793     sqlite3BtreeLeave(pFrom);
   792    794     sqlite3BtreeLeave(pTo);
   793    795     return rc;
   794    796   }
   795    797   #endif /* SQLITE_OMIT_VACUUM */

Changes to src/build.c.

  3033   3033       int n;
  3034   3034       Index *pLoop;
  3035   3035       for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
  3036   3036       zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
  3037   3037       if( zName==0 ){
  3038   3038         goto exit_create_index;
  3039   3039       }
         3040  +
         3041  +    /* Automatic index names generated from within sqlite3_declare_vtab()
         3042  +    ** must have names that are distinct from normal automatic index names.
         3043  +    ** The following statement converts "sqlite3_autoindex..." into
         3044  +    ** "sqlite3_butoindex..." in order to make the names distinct.
         3045  +    ** The "vtab_err.test" test demonstrates the need of this statement. */
         3046  +    if( IN_DECLARE_VTAB ) zName[7]++;
  3040   3047     }
  3041   3048   
  3042   3049     /* Check for authorization to create an index.
  3043   3050     */
  3044   3051   #ifndef SQLITE_OMIT_AUTHORIZATION
  3045   3052     {
  3046   3053       const char *zDb = pDb->zName;

Changes to src/pager.c.

  7190   7190   ** in backup.c maintains the content of this variable. This module
  7191   7191   ** uses it opaquely as an argument to sqlite3BackupRestart() and
  7192   7192   ** sqlite3BackupUpdate() only.
  7193   7193   */
  7194   7194   sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){
  7195   7195     return &pPager->pBackup;
  7196   7196   }
         7197  +
         7198  +#ifndef SQLITE_OMIT_VACUUM
         7199  +/*
         7200  +** Unless this is an in-memory or temporary database, clear the pager cache.
         7201  +*/
         7202  +void sqlite3PagerClearCache(Pager *pPager){
         7203  +  assert( MEMDB==0 || pPager->tempFile );
         7204  +  if( pPager->tempFile==0 ) pager_reset(pPager);
         7205  +}
         7206  +#endif
         7207  +
  7197   7208   
  7198   7209   #ifndef SQLITE_OMIT_WAL
  7199   7210   /*
  7200   7211   ** This function is called when the user invokes "PRAGMA wal_checkpoint",
  7201   7212   ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
  7202   7213   ** or wal_blocking_checkpoint() API functions.
  7203   7214   **
................................................................................
  7426   7437   ** is empty, return 0.
  7427   7438   */
  7428   7439   int sqlite3PagerWalFramesize(Pager *pPager){
  7429   7440     assert( pPager->eState>=PAGER_READER );
  7430   7441     return sqlite3WalFramesize(pPager->pWal);
  7431   7442   }
  7432   7443   #endif
  7433         -
  7434   7444   
  7435   7445   #endif /* SQLITE_OMIT_DISKIO */

Changes to src/pager.h.

   200    200   sqlite3_file *sqlite3PagerFile(Pager*);
   201    201   sqlite3_file *sqlite3PagerWalFile(Pager *pPager);
   202    202   sqlite3_file *sqlite3PagerJrnlFile(Pager*);
   203    203   const char *sqlite3PagerJournalname(Pager*);
   204    204   void *sqlite3PagerTempSpace(Pager*);
   205    205   int sqlite3PagerIsMemdb(Pager*);
   206    206   void sqlite3PagerCacheStat(Pager *, int, int, int *);
          207  +void sqlite3PagerClearCache(Pager*);
   207    208   int sqlite3SectorSize(sqlite3_file *);
   208    209   
   209    210   /* Functions used to truncate the database file. */
   210    211   void sqlite3PagerTruncateImage(Pager*,Pgno);
   211    212   
   212    213   void sqlite3PagerRekey(DbPage*, Pgno, u16);
   213    214   

Changes to src/sqlite.h.in.

  1956   1956   ** <dt>SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION</dt>
  1957   1957   ** <dd> ^This option is used to enable or disable the [sqlite3_load_extension()]
  1958   1958   ** interface independently of the [load_extension()] SQL function.
  1959   1959   ** The [sqlite3_enable_load_extension()] API enables or disables both the
  1960   1960   ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
  1961   1961   ** There should be two additional arguments.
  1962   1962   ** When the first argument to this interface is 1, then only the C-API is
  1963         -** enabled and the SQL function remains disabled.  If the first argment to
         1963  +** enabled and the SQL function remains disabled.  If the first argument to
  1964   1964   ** this interface is 0, then both the C-API and the SQL function are disabled.
  1965   1965   ** If the first argument is -1, then no changes are made to state of either the
  1966   1966   ** C-API or the SQL function.
  1967   1967   ** The second parameter is a pointer to an integer into which
  1968   1968   ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
  1969   1969   ** is disabled or enabled following this call.  The second parameter may
  1970   1970   ** be a NULL pointer, in which case the new setting is not reported back.
................................................................................
  5534   5534   ** information about column C of table T in database D
  5535   5535   ** on [database connection] X.)^  ^The sqlite3_table_column_metadata()
  5536   5536   ** interface returns SQLITE_OK and fills in the non-NULL pointers in
  5537   5537   ** the final five arguments with appropriate values if the specified
  5538   5538   ** column exists.  ^The sqlite3_table_column_metadata() interface returns
  5539   5539   ** SQLITE_ERROR and if the specified column does not exist.
  5540   5540   ** ^If the column-name parameter to sqlite3_table_column_metadata() is a
  5541         -** NULL pointer, then this routine simply checks for the existance of the
         5541  +** NULL pointer, then this routine simply checks for the existence of the
  5542   5542   ** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
  5543   5543   ** does not.
  5544   5544   **
  5545   5545   ** ^The column is identified by the second, third and fourth parameters to
  5546   5546   ** this function. ^(The second parameter is either the name of the database
  5547   5547   ** (i.e. "main", "temp", or an attached database) containing the specified
  5548   5548   ** table or NULL.)^ ^If it is NULL, then all attached databases are searched
................................................................................
  8129   8129   ** ^The preupdate hook only fires for changes to [rowid tables]; the preupdate
  8130   8130   ** hook is not invoked for changes to [virtual tables] or [WITHOUT ROWID]
  8131   8131   ** tables.
  8132   8132   **
  8133   8133   ** ^The second parameter to the preupdate callback is a pointer to
  8134   8134   ** the [database connection] that registered the preupdate hook.
  8135   8135   ** ^The third parameter to the preupdate callback is one of the constants
  8136         -** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
         8136  +** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
  8137   8137   ** kind of update operation that is about to occur.
  8138   8138   ** ^(The fourth parameter to the preupdate callback is the name of the
  8139   8139   ** database within the database connection that is being modified.  This
  8140   8140   ** will be "main" for the main database or "temp" for TEMP tables or 
  8141   8141   ** the name given after the AS keyword in the [ATTACH] statement for attached
  8142   8142   ** databases.)^
  8143   8143   ** ^The fifth parameter to the preupdate callback is the name of the

Changes to src/vtab.c.

   803    803   ** This call is a no-op if zTab is not a virtual table.
   804    804   */
   805    805   int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
   806    806     int rc = SQLITE_OK;
   807    807     Table *pTab;
   808    808   
   809    809     pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
   810         -  if( ALWAYS(pTab!=0 && pTab->pVTable!=0) ){
          810  +  if( pTab!=0 && ALWAYS(pTab->pVTable!=0) ){
   811    811       VTable *p;
   812    812       int (*xDestroy)(sqlite3_vtab *);
   813    813       for(p=pTab->pVTable; p; p=p->pNext){
   814    814         assert( p->pVtab );
   815    815         if( p->pVtab->nRef>0 ){
   816    816           return SQLITE_LOCKED;
   817    817         }

Changes to test/stat.test.

    30     30   proc a_string {n} { string range [string repeat [incr ::asc]. $n] 1 $n }
    31     31   db func a_string a_string
    32     32   
    33     33   register_dbstat_vtab db
    34     34   do_execsql_test stat-0.0 {
    35     35     PRAGMA table_info(dbstat);
    36     36   } {/0 name TEXT .* 1 path TEXT .* 9 pgsize INTEGER/}
           37  +
           38  +# Attempts to drop an eponymous virtual table are a no-op.
    37     39   do_execsql_test stat-0.1 {
           40  +  DROP TABLE dbstat;
           41  +  PRAGMA table_info=dbstat;
           42  +} {/0 name TEXT .* 1 path TEXT .* 9 pgsize INTEGER/}
           43  +
           44  +db close
           45  +forcedelete test.db
           46  +sqlite3 db test.db
           47  +db func a_string a_string
           48  +register_dbstat_vtab db
           49  +do_execsql_test stat-0.2 {
    38     50     PRAGMA auto_vacuum = OFF;
    39     51     CREATE VIRTUAL TABLE temp.stat USING dbstat;
    40     52     SELECT * FROM stat;
    41     53   } {}
           54  +
    42     55   
    43     56   if {[wal_is_capable]} {
    44     57     do_execsql_test stat-0.1 {
    45     58       PRAGMA journal_mode = WAL;
    46     59       PRAGMA journal_mode = delete;
    47     60       SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
    48     61         FROM stat;