Fossil

Check-in [b0d61b05d3]
Login

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

Overview
Comment:Refactor db_close() so that it can make use of db_close_config().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0d61b05d3e843e23d0754fb3c04d7b4ff46052e
User & Date: mistachkin 2014-06-16 16:31:25.056
Context
2014-06-16
16:44
Update the list of changes. check-in: 42dec3fedd user: mistachkin tags: trunk
16:31
Refactor db_close() so that it can make use of db_close_config(). check-in: b0d61b05d3 user: mistachkin tags: trunk
12:33
Since this hack only fixes part of fossil's Cygwin-specific problems, just remove it. The recommended way to configure fossil on Cygwin is now using --disable-internal-sqlite, which works much better. See: [https://www.sourceware.org/ml/cygwin/2014-06/msg00171.html] check-in: 9462a0b51f user: jan.nijtmans tags: trunk
2014-06-15
23:55
Merge updates from trunk. Closed-Leaf check-in: eabb27e8c7 user: mistachkin tags: dbCloseConfig
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
790
791
792
793
794
795
796

797
798
799
800
801

802
803
804
805
806
807
808
*/
void db_close_config(){
  if( g.useAttach ){
    db_detach("configdb");
    g.useAttach = 0;
    g.zConfigDbName = 0;
  }else if( g.dbConfig ){

    sqlite3_close(g.dbConfig);
    g.dbConfig = 0;
    g.zConfigDbType = 0;
    g.zConfigDbName = 0;
  }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){

    sqlite3_close(g.db);
    g.db = 0;
    g.zMainDbType = 0;
    g.zConfigDbName = 0;
  }
}








>





>







790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
*/
void db_close_config(){
  if( g.useAttach ){
    db_detach("configdb");
    g.useAttach = 0;
    g.zConfigDbName = 0;
  }else if( g.dbConfig ){
    sqlite3_wal_checkpoint(g.dbConfig, 0);
    sqlite3_close(g.dbConfig);
    g.dbConfig = 0;
    g.zConfigDbType = 0;
    g.zConfigDbName = 0;
  }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){
    sqlite3_wal_checkpoint(g.db, 0);
    sqlite3_close(g.db);
    g.db = 0;
    g.zMainDbType = 0;
    g.zConfigDbName = 0;
  }
}

1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239



1240
1241

1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
  db_end_transaction(1);
  pStmt = 0;
  if( reportErrors ){
    while( (pStmt = sqlite3_next_stmt(g.db, pStmt))!=0 ){
      fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
    }
  }
  g.repositoryOpen = 0;
  g.localOpen = 0;
  g.zConfigDbName = NULL;
  sqlite3_wal_checkpoint(g.db, 0);
  sqlite3_close(g.db);
  g.db = 0;
  g.zMainDbType = 0;



  if( g.dbConfig ){
    sqlite3_close(g.dbConfig);

    g.dbConfig = 0;
    g.zConfigDbType = 0;
  }
}


/*
** Create a new empty repository database with the given name.
**
** Only the schema is initialized.  The required VAR tables entries







|
|
<
|
|
|
|
>
>
>
|
<
>
|
|
<







1228
1229
1230
1231
1232
1233
1234
1235
1236

1237
1238
1239
1240
1241
1242
1243
1244

1245
1246
1247

1248
1249
1250
1251
1252
1253
1254
  db_end_transaction(1);
  pStmt = 0;
  if( reportErrors ){
    while( (pStmt = sqlite3_next_stmt(g.db, pStmt))!=0 ){
      fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
    }
  }
  db_close_config();
  if( g.db ){

    sqlite3_wal_checkpoint(g.db, 0);
    sqlite3_close(g.db);
    g.db = 0;
    g.zMainDbType = 0;
  }
  g.repositoryOpen = 0;
  g.localOpen = 0;
  assert( g.dbConfig==0 );

  assert( g.useAttach==0 );
  assert( g.zConfigDbName==0 );
  assert( g.zConfigDbType==0 );

}


/*
** Create a new empty repository database with the given name.
**
** Only the schema is initialized.  The required VAR tables entries