1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Begin testing the new ATTACH and DETACH commands. (CVS 898)

FossilOrigin-Name: 7a0f8024a1323a15d0c83afe9302400736f01fe8
This commit is contained in:
drh
2003-04-05 03:42:26 +00:00
parent f539f6a7e9
commit 2d4583473b
6 changed files with 103 additions and 17 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.120 2003/04/03 15:46:04 drh Exp $
** $Id: main.c,v 1.121 2003/04/05 03:42:27 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -297,9 +297,15 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
sqliteSetString(pzErrMsg, "unsupported file format", 0);
return SQLITE_ERROR;
}
}else if( db->file_format<4 || db->file_format!=meta[2] ){
sqliteSetString(pzErrMsg, "incompatible file format in auxiliary "
"database \"", db->aDb[iDb].zName, "\"", 0);
}else if( db->file_format!=meta[2] || db->file_format<4 ){
assert( db->file_format>=4 );
if( meta[2]==0 ){
sqliteSetString(pzErrMsg, "cannot attach empty database: ",
db->aDb[iDb].zName, 0);
}else{
sqliteSetString(pzErrMsg, "incompatible file format in auxiliary "
"database: ", db->aDb[iDb].zName, 0);
}
sqliteBtreeClose(db->aDb[iDb].pBt);
db->aDb[iDb].pBt = 0;
return SQLITE_FORMAT;