Differences From:
File
src/db.c
part of check-in
[02f09cdd6c]
- Add the http-port setting used to specify the default TCP/IP port for the
built-in webserver. Ticket 7168128e09.
by
drh on
2008-11-09 16:23:30.
[view]
To:
File
src/db.c
part of check-in
[e146d800ac]
- Add the "mv" and "rename" commands (aliases for the same thing).
by
drh on
2008-11-09 19:22:06.
[view]
@@ -675,15 +675,26 @@
** true. If it is not a valid local database file, return 0.
*/
static int isValidLocalDb(const char *zDbName){
i64 lsize;
+ int rc;
+ sqlite3_stmt *pStmt;
+
if( access(zDbName, F_OK) ) return 0;
lsize = file_size(zDbName);
if( lsize%1024!=0 || lsize<4096 ) return 0;
db_open_or_attach(zDbName, "localdb");
g.localOpen = 1;
db_open_config();
db_open_repository(0);
+
+ /* If the "origname" column is missing from the vfile table, then
+ ** add it now. */
+ rc = sqlite3_prepare(g.db, "SELECT origname FROM vfile", -1, &pStmt, 0);
+ if( rc==SQLITE_ERROR ){
+ sqlite3_exec(g.db, "ALTER TABLE vfile ADD COLUMN origname TEXT", 0, 0, 0);
+ }
+
return 1;
}
/*