1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix for ticket #114: Correctly handle SQLITE_BUSY if it occurs during

database initialization. (CVS 696)

FossilOrigin-Name: 5b814b5df667ccc91d85fbb7f96e523483e9219b
This commit is contained in:
drh
2002-07-30 18:43:40 +00:00
parent c51d204464
commit 92ed08a9d7
4 changed files with 32 additions and 12 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.92 2002/07/19 19:03:42 drh Exp $
** $Id: main.c,v 1.93 2002/07/30 18:43:41 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -238,12 +238,16 @@ int sqliteInit(sqlite *db, char **pzErrMsg){
*/
if( db->pBe==0 ) return SQLITE_OK;
rc = sqliteBtreeCursor(db->pBe, 2, 0, &curMain);
if( rc ) return rc;
if( rc ){
sqliteResetInternalSchema(db);
return rc;
}
/* Get the database meta information
*/
rc = sqliteBtreeGetMeta(db->pBe, meta);
if( rc ){
sqliteResetInternalSchema(db);
sqliteBtreeCloseCursor(curMain);
return rc;
}
@@ -374,7 +378,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
** upgrade fails for any reason (ex: out of disk space, database
** is read only, interrupt receive, etc.) then refuse to open.
*/
if( db->file_format<3 ){
if( rc==SQLITE_OK && db->file_format<3 ){
char *zErr = 0;
InitData initData;
int meta[SQLITE_N_BTREE_META];