Fossil

Check-in [7536c6ae]
Login

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

Overview
Comment:Fix the sqlite3_open() used by "fossil init" so that it will honor the FOSSIL_VFS environment variable.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7536c6aea562700127969610873a9891d4b4fed0
User & Date: drh 2013-01-17 22:23:17
Context
2013-01-18
00:47
Consolidate all sqlite3_open() calls into the db_open() routine and initialize every database connection the same way. Avoid using sqlite3_exec() in order to obtain a more accurate count of perpared statements when --sqltrace is used. check-in: f97e1cf6 user: drh tags: trunk
2013-01-17
22:23
Fix the sqlite3_open() used by "fossil init" so that it will honor the FOSSIL_VFS environment variable. check-in: 7536c6ae user: drh tags: trunk
18:13
Merge in the latest SQLite from upstream, in order to test SQLite. check-in: d7019134 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/db.c.

640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
...
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
  ...                      /* Additional SQL to run.  Terminate with NULL. */
){
  sqlite3 *db;
  int rc;
  const char *zSql;
  va_list ap;

  rc = sqlite3_open(zFileName, &db);
  if( rc!=SQLITE_OK ){
    db_err("[%s] %s", zFileName, sqlite3_errmsg(db));
  }
  sqlite3_busy_timeout(db, 5000);
  sqlite3_exec(db, "BEGIN EXCLUSIVE", 0, 0, 0);
  rc = sqlite3_exec(db, zSchema, 0, 0, 0);
  if( rc!=SQLITE_OK ){
    db_err(sqlite3_errmsg(db));
  }
  va_start(ap, zSchema);
  while( (zSql = va_arg(ap, const char*))!=0 ){
................................................................................
}


/*
** Open a database file.  Return a pointer to the new database
** connection.  An error results in process abort.
*/
static sqlite3 *openDatabase(const char *zDbName){
  int rc;
  const char *zVfs;
  sqlite3 *db;

  if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
  zVfs = fossil_getenv("FOSSIL_VFS");
  rc = sqlite3_open_v2(







|
<
<
<
<







 







|







640
641
642
643
644
645
646
647




648
649
650
651
652
653
654
...
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
  ...                      /* Additional SQL to run.  Terminate with NULL. */
){
  sqlite3 *db;
  int rc;
  const char *zSql;
  va_list ap;

  db = openDatabase(zFileName);




  sqlite3_exec(db, "BEGIN EXCLUSIVE", 0, 0, 0);
  rc = sqlite3_exec(db, zSchema, 0, 0, 0);
  if( rc!=SQLITE_OK ){
    db_err(sqlite3_errmsg(db));
  }
  va_start(ap, zSchema);
  while( (zSql = va_arg(ap, const char*))!=0 ){
................................................................................
}


/*
** Open a database file.  Return a pointer to the new database
** connection.  An error results in process abort.
*/
LOCAL sqlite3 *openDatabase(const char *zDbName){
  int rc;
  const char *zVfs;
  sqlite3 *db;

  if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
  zVfs = fossil_getenv("FOSSIL_VFS");
  rc = sqlite3_open_v2(