Fossil

Check-in [032188a6]
Login

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

Overview
Comment:Update the built-in SQLite to the second 3.23.0 beta.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:032188a698d937324770389d03e3d98f6416ea3a7029442f788cee6fd78b929d
User & Date: drh 2018-03-29 15:42:11
Context
2018-03-29
17:03
Also allow the '-' character in parameter and cookie names. This is necessary for the login cookie. check-in: 21780aef user: drh tags: trunk
15:42
Update the built-in SQLite to the second 3.23.0 beta. check-in: 032188a6 user: drh tags: trunk
15:24
Extra comment describing the previous change. check-in: 6c02983d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite3.c.

  1145   1145   **
  1146   1146   ** See also: [sqlite3_libversion()],
  1147   1147   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
  1148   1148   ** [sqlite_version()] and [sqlite_source_id()].
  1149   1149   */
  1150   1150   #define SQLITE_VERSION        "3.23.0"
  1151   1151   #define SQLITE_VERSION_NUMBER 3023000
  1152         -#define SQLITE_SOURCE_ID      "2018-03-28 15:56:55 eb29b3369e76ec1df25a5484d8ec5fb924e23d5c70aaa4d794b2b17ee187alt1"
         1152  +#define SQLITE_SOURCE_ID      "2018-03-29 13:47:01 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2ecda"
  1153   1153   
  1154   1154   /*
  1155   1155   ** CAPI3REF: Run-Time Library Version Numbers
  1156   1156   ** KEYWORDS: sqlite3_version sqlite3_sourceid
  1157   1157   **
  1158   1158   ** These interfaces provide the same information as the [SQLITE_VERSION],
  1159   1159   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
 21300  21300       ** The core must call OsFileControl() though, not OsFileControlHint(),
 21301  21301       ** as if a custom VFS (e.g. zipvfs) returns an error here, it probably
 21302  21302       ** means the commit really has failed and an error should be returned
 21303  21303       ** to the user.  */
 21304  21304       DO_OS_MALLOC_TEST(id);
 21305  21305     }
 21306  21306   #endif
        21307  +  if( id->pMethods==0 ) return SQLITE_NOTFOUND;
 21307  21308     return id->pMethods->xFileControl(id, op, pArg);
 21308  21309   }
 21309  21310   SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
 21310         -  (void)id->pMethods->xFileControl(id, op, pArg);
        21311  +  if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
 21311  21312   }
 21312  21313   
 21313  21314   SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
 21314  21315     int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
 21315  21316     return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
 21316  21317   }
 21317  21318   SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
................................................................................
 51215  51216       ** successfully committed, but the EXCLUSIVE lock is still held on the
 51216  51217       ** file. So it is safe to truncate the database file to its minimum
 51217  51218       ** required size.  */
 51218  51219       assert( pPager->eLock==EXCLUSIVE_LOCK );
 51219  51220       rc = pager_truncate(pPager, pPager->dbSize);
 51220  51221     }
 51221  51222   
 51222         -  if( rc==SQLITE_OK && bCommit && isOpen(pPager->fd) ){
        51223  +  if( rc==SQLITE_OK && bCommit ){
 51223  51224       rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_COMMIT_PHASETWO, 0);
 51224  51225       if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
 51225  51226     }
 51226  51227   
 51227  51228     if( !pPager->exclusiveMode 
 51228  51229      && (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0))
 51229  51230     ){
................................................................................
 52034  52035     }
 52035  52036     /* Following a rollback, the database file should be back in its original
 52036  52037     ** state prior to the start of the transaction, so invoke the
 52037  52038     ** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the
 52038  52039     ** assertion that the transaction counter was modified.
 52039  52040     */
 52040  52041   #ifdef SQLITE_DEBUG
 52041         -  if( pPager->fd->pMethods ){
 52042         -    sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
 52043         -  }
        52042  +  sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
 52044  52043   #endif
 52045  52044   
 52046  52045     /* If this playback is happening automatically as a result of an IO or 
 52047  52046     ** malloc error that occurred after the change-counter was updated but 
 52048  52047     ** before the transaction was committed, then the change-counter 
 52049  52048     ** modification may just have been reverted. If this happens in exclusive 
 52050  52049     ** mode, then subsequent transactions performed by the connection will not
................................................................................
 52794  52793   ** returned to the caller of the pager API function.
 52795  52794   */
 52796  52795   SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(
 52797  52796     Pager *pPager,                       /* Pager object */
 52798  52797     int (*xBusyHandler)(void *),         /* Pointer to busy-handler function */
 52799  52798     void *pBusyHandlerArg                /* Argument to pass to xBusyHandler */
 52800  52799   ){
        52800  +  void **ap;
 52801  52801     pPager->xBusyHandler = xBusyHandler;
 52802  52802     pPager->pBusyHandlerArg = pBusyHandlerArg;
 52803         -
 52804         -  if( isOpen(pPager->fd) ){
 52805         -    void **ap = (void **)&pPager->xBusyHandler;
 52806         -    assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
 52807         -    assert( ap[1]==pBusyHandlerArg );
 52808         -    sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
 52809         -  }
        52803  +  ap = (void **)&pPager->xBusyHandler;
        52804  +  assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
        52805  +  assert( ap[1]==pBusyHandlerArg );
        52806  +  sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
 52810  52807   }
 52811  52808   
 52812  52809   /*
 52813  52810   ** Change the page size used by the Pager object. The new page size 
 52814  52811   ** is passed in *pPageSize.
 52815  52812   **
 52816  52813   ** If the pager is in the error state when this function is called, it
................................................................................
 55374  55371   ** or pages with the Pager.noSync flag set.
 55375  55372   **
 55376  55373   ** If successful, or if called on a pager for which it is a no-op, this
 55377  55374   ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
 55378  55375   */
 55379  55376   SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){
 55380  55377     int rc = SQLITE_OK;
 55381         -
 55382         -  if( isOpen(pPager->fd) ){
 55383         -    void *pArg = (void*)zMaster;
 55384         -    rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
 55385         -    if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
 55386         -  }
        55378  +  void *pArg = (void*)zMaster;
        55379  +  rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
        55380  +  if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
 55387  55381     if( rc==SQLITE_OK && !pPager->noSync ){
 55388  55382       assert( !MEMDB );
 55389  55383       rc = sqlite3OsSync(pPager->fd, pPager->syncFlags);
 55390  55384     }
 55391  55385     return rc;
 55392  55386   }
 55393  55387   
................................................................................
 56061  56055   }
 56062  56056   
 56063  56057   #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
 56064  56058   /*
 56065  56059   ** Reset the lock timeout for pager.
 56066  56060   */
 56067  56061   SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager){
 56068         -  if( isOpen(pPager->fd) ){
 56069         -    int x = 0;
 56070         -    sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x);
 56071         -  }
        56062  +  int x = 0;
        56063  +  sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x);
 56072  56064   }
 56073  56065   #endif
 56074  56066   
 56075  56067   /*
 56076  56068   ** Return the file handle for the journal file (if it exists).
 56077  56069   ** This will be either the rollback journal or the WAL file.
 56078  56070   */
................................................................................
146487 146479         tmout = 0;
146488 146480         sqlite3OsFileControl(pFile, SQLITE_FCNTL_LOCK_TIMEOUT, &tmout);
146489 146481         return 0;
146490 146482       }else{
146491 146483         return 1;
146492 146484       }
146493 146485     }
       146486  +#else
       146487  +  UNUSED_PARAMETER(pFile);
146494 146488   #endif
146495 146489     assert( count>=0 );
146496 146490     if( count < NDELAY ){
146497 146491       delay = delays[count];
146498 146492       prior = totals[count];
146499 146493     }else{
146500 146494       delay = delays[NDELAY-1];
................................................................................
146507 146501     sqlite3OsSleep(db->pVfs, delay*1000);
146508 146502     return 1;
146509 146503   #else
146510 146504     /* This case for unix systems that lack usleep() support.  Sleeping
146511 146505     ** must be done in increments of whole seconds */
146512 146506     sqlite3 *db = (sqlite3 *)ptr;
146513 146507     int tmout = ((sqlite3 *)ptr)->busyTimeout;
       146508  +  UNUSED_PARAMETER(pFile);
146514 146509     if( (count+1)*1000 > tmout ){
146515 146510       return 0;
146516 146511     }
146517 146512     sqlite3OsSleep(db->pVfs, 1000000);
146518 146513     return 1;
146519 146514   #endif
146520 146515   }
................................................................................
148605 148600         rc = SQLITE_OK;
148606 148601       }else if( op==SQLITE_FCNTL_VFS_POINTER ){
148607 148602         *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
148608 148603         rc = SQLITE_OK;
148609 148604       }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
148610 148605         *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
148611 148606         rc = SQLITE_OK;
148612         -    }else if( fd->pMethods ){
       148607  +    }else{
148613 148608         rc = sqlite3OsFileControl(fd, op, pArg);
148614         -    }else{
148615         -      rc = SQLITE_NOTFOUND;
148616 148609       }
148617 148610       sqlite3BtreeLeave(pBtree);
148618 148611     }
148619 148612     sqlite3_mutex_leave(db->mutex);
148620 148613     return rc;
148621 148614   }
148622 148615   
................................................................................
179679 179672     pCsr->iOffset = (i64)pCsr->szPage * (pCsr->iPageno - 1);
179680 179673   
179681 179674     /* If connected to a ZIPVFS backend, override the page size and
179682 179675     ** offset with actual values obtained from ZIPVFS.
179683 179676     */
179684 179677     fd = sqlite3PagerFile(pPager);
179685 179678     x[0] = pCsr->iPageno;
179686         -  if( fd->pMethods!=0 && sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
       179679  +  if( sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
179687 179680       pCsr->iOffset = x[0];
179688 179681       pCsr->szPage = (int)x[1];
179689 179682     }
179690 179683   }
179691 179684   
179692 179685   /*
179693 179686   ** Move a statvfs cursor to the next entry in the file.
................................................................................
205562 205555   static void fts5SourceIdFunc(
205563 205556     sqlite3_context *pCtx,          /* Function call context */
205564 205557     int nArg,                       /* Number of args */
205565 205558     sqlite3_value **apUnused        /* Function arguments */
205566 205559   ){
205567 205560     assert( nArg==0 );
205568 205561     UNUSED_PARAM2(nArg, apUnused);
205569         -  sqlite3_result_text(pCtx, "fts5: 2018-03-26 16:37:53 6c40c5574f4ae9795a142d01a8f84afd1b72678ea5f6bfca14a8646c4e862605", -1, SQLITE_TRANSIENT);
       205562  +  sqlite3_result_text(pCtx, "fts5: 2018-03-29 13:47:01 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2ecda", -1, SQLITE_TRANSIENT);
205570 205563   }
205571 205564   
205572 205565   static int fts5Init(sqlite3 *db){
205573 205566     static const sqlite3_module fts5Mod = {
205574 205567       /* iVersion      */ 2,
205575 205568       /* xCreate       */ fts5CreateMethod,
205576 205569       /* xConnect      */ fts5ConnectMethod,
................................................................................
209832 209825   #endif
209833 209826     return rc;
209834 209827   }
209835 209828   #endif /* SQLITE_CORE */
209836 209829   #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
209837 209830   
209838 209831   /************** End of stmt.c ************************************************/
209839         -#if __LINE__!=209839
       209832  +#if __LINE__!=209832
209840 209833   #undef SQLITE_SOURCE_ID
209841         -#define SQLITE_SOURCE_ID      "2018-03-28 15:56:55 eb29b3369e76ec1df25a5484d8ec5fb924e23d5c70aaa4d794b2b17ee187alt2"
       209834  +#define SQLITE_SOURCE_ID      "2018-03-29 13:47:01 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2alt2"
209842 209835   #endif
209843 209836   /* Return the source-id for this library */
209844 209837   SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
209845 209838   /************************** End of sqlite3.c ******************************/

Changes to src/sqlite3.h.

   121    121   **
   122    122   ** See also: [sqlite3_libversion()],
   123    123   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   124    124   ** [sqlite_version()] and [sqlite_source_id()].
   125    125   */
   126    126   #define SQLITE_VERSION        "3.23.0"
   127    127   #define SQLITE_VERSION_NUMBER 3023000
   128         -#define SQLITE_SOURCE_ID      "2018-03-28 15:56:55 eb29b3369e76ec1df25a5484d8ec5fb924e23d5c70aaa4d794b2b17ee187alt1"
          128  +#define SQLITE_SOURCE_ID      "2018-03-29 13:47:01 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2ecda"
   129    129   
   130    130   /*
   131    131   ** CAPI3REF: Run-Time Library Version Numbers
   132    132   ** KEYWORDS: sqlite3_version sqlite3_sourceid
   133    133   **
   134    134   ** These interfaces provide the same information as the [SQLITE_VERSION],
   135    135   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros