Fossil

Check-in [0d28198d]
Login

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

Overview
Comment:Update the built-in SQLite to include the change that makes "main" an acceptable alias for the primary database, even if the primary database has been renamed to "repository" or "localdb".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0d28198d0394ab8e590afc3f29444ed610925704
User & Date: drh 2016-12-24 19:38:14
Context
2016-12-24
21:55
Improved documentation of the "fossil sql" command. Add a note to the change log discussing recent enhancements to the "fossil sql" command. check-in: a52f1967 user: drh tags: trunk
19:38
Update the built-in SQLite to include the change that makes "main" an acceptable alias for the primary database, even if the primary database has been renamed to "repository" or "localdb". check-in: 0d28198d user: drh tags: trunk
18:19
Update the shell.c file from upstream (SQLite) so that the ".databases" command works with arbitrary-length filenames. check-in: 277774b4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/sqlite3.c.

379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
.....
99543
99544
99545
99546
99547
99548
99549
99550



99551
99552
99553
99554
99555
99556
99557
......
142801
142802
142803
142804
142805
142806
142807
142808
142809
142810
142811
142812
142813
142814
142815
142816
142817
142818
142819
142820
142821
142822
142823
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.16.0"
#define SQLITE_VERSION_NUMBER 3016000
#define SQLITE_SOURCE_ID      "2016-12-23 16:05:22 2940661b8c014b94973e05c44f1b1f4f443dbdd3"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
** -1 if the named db cannot be found.
*/
SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
  int i = -1;         /* Database number */
  if( zName ){
    Db *pDb;
    for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
      if( 0==sqlite3StrICmp(pDb->zDbSName, zName) ) break;



    }
  }
  return i;
}

/*
** The token *pName contains the name of a database (either "main" or
................................................................................
  return bDflt;
}

/*
** Return the Btree pointer identified by zDbName.  Return NULL if not found.
*/
SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
  int i;
  for(i=0; i<db->nDb; i++){
    if( db->aDb[i].pBt
     && (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zDbSName)==0)
    ){
      return db->aDb[i].pBt;
    }
  }
  return 0;
}

/*
** Return the filename of the database associated with a database
** connection.
*/
SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){







|







 







|
>
>
>







 







|
<
|
<
<
<
<
<
<







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
.....
99543
99544
99545
99546
99547
99548
99549
99550
99551
99552
99553
99554
99555
99556
99557
99558
99559
99560
......
142804
142805
142806
142807
142808
142809
142810
142811

142812






142813
142814
142815
142816
142817
142818
142819
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.16.0"
#define SQLITE_VERSION_NUMBER 3016000
#define SQLITE_SOURCE_ID      "2016-12-24 19:37:16 2f481b854f04bec546eb172d1b6dbc88067d3fda"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
** -1 if the named db cannot be found.
*/
SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
  int i = -1;         /* Database number */
  if( zName ){
    Db *pDb;
    for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
      if( 0==sqlite3_stricmp(pDb->zDbSName, zName) ) break;
      /* "main" is always an acceptable alias for the primary database
      ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */
      if( i==0 && 0==sqlite3_stricmp("main", zName) ) break;
    }
  }
  return i;
}

/*
** The token *pName contains the name of a database (either "main" or
................................................................................
  return bDflt;
}

/*
** Return the Btree pointer identified by zDbName.  Return NULL if not found.
*/
SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
  int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0;

  return iDb<0 ? 0 : db->aDb[iDb].pBt;






}

/*
** Return the filename of the database associated with a database
** connection.
*/
SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){

Changes to src/sqlite3.h.

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.16.0"
#define SQLITE_VERSION_NUMBER 3016000
#define SQLITE_SOURCE_ID      "2016-12-23 16:05:22 2940661b8c014b94973e05c44f1b1f4f443dbdd3"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros







|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.16.0"
#define SQLITE_VERSION_NUMBER 3016000
#define SQLITE_SOURCE_ID      "2016-12-24 19:37:16 2f481b854f04bec546eb172d1b6dbc88067d3fda"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros