In sqlite3_table_column_metadata(), hold the mutex on all attached BtShared objects while accessing schema objects. Fix for #3679. (CVS 6328)
FossilOrigin-Name: d197afd658eecfc0e24913e5a779c8f1e2a138a6
diff --git a/src/main.c b/src/main.c
index 9b4578a..e4f92e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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.529 2009/02/23 14:42:53 danielk1977 Exp $
+** $Id: main.c,v 1.530 2009/02/26 07:15:59 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -1933,7 +1933,6 @@
(void)sqlite3SafetyOn(db);
sqlite3BtreeEnterAll(db);
rc = sqlite3Init(db, &zErrMsg);
- sqlite3BtreeLeaveAll(db);
if( SQLITE_OK!=rc ){
goto error_out;
}
@@ -1989,6 +1988,7 @@
}
error_out:
+ sqlite3BtreeLeaveAll(db);
(void)sqlite3SafetyOff(db);
/* Whether the function call succeeded or failed, set the output parameters