Diff
Not logged in

Differences From:

File src/db.c part of check-in [74f7f6e6ad] - Fix faulty SQL in the "db_unset()" routine. Ticket 31bd22c31fcc by drh on 2009-08-15 16:50:36. [view]

To:

File src/db.c part of check-in [a25092b14c] - Be sure to call mbcsToUtf8() when opening the global configuration database. Ticket c7c36ef52edab by drh on 2009-08-15 21:38:24. [view]

@@ -630,8 +630,11 @@
   const char *zVfs;
   sqlite3 *db;
 
   zVfs = getenv("FOSSIL_VFS");
+#ifdef __MINGW32__
+  zDbName = mbcsToUtf8(zDbName);
+#endif
   rc = sqlite3_open_v2(
        zDbName, &db,
        SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
        zVfs
@@ -649,15 +652,15 @@
 ** file is open, then open this one.  If another database file is
 ** already open, then attach zDbName using the name zLabel.
 */
 void db_open_or_attach(const char *zDbName, const char *zLabel){
-#ifdef __MINGW32__
-  zDbName = mbcsToUtf8(zDbName);
-#endif
   if( !g.db ){
     g.db = openDatabase(zDbName);
     db_connection_init();
   }else{
+#ifdef __MINGW32__
+    zDbName = mbcsToUtf8(zDbName);
+#endif
     db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
   }
 }