mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix a bug in DROP TABLE that could cause SQLITE_MASTER table corruption.
The root problem was that the sequence of BTree operations (Delete, Next) would not always leave the cursor pointing at the first entry after the entry that was deleted. A consequence of this error was that a DROP TABLE on a table with indices would not always remove every index associated with that table from the SQLITE_MASTER table. Subsequent attempts to open the database will fail when the index for the missing table was parsed. Changes have also been made to ignore extra indices in the SQLITE_MASTER table so that a database previously corrupted by this bug is once again readable. (CVS 316) FossilOrigin-Name: 8a984667113564f2bac7412165b6ff8b7e3e8f70
This commit is contained in:
@@ -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.49 2001/11/07 16:48:27 drh Exp $
|
||||
** $Id: main.c,v 1.50 2001/11/23 00:24:12 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -63,7 +63,7 @@ static int sqliteOpenCb(void *pDb, int argc, char **argv, char **azColName){
|
||||
sParse.db = db;
|
||||
sParse.initFlag = 1;
|
||||
sParse.newTnum = atoi(argv[2]);
|
||||
nErr = sqliteRunParser(&sParse, argv[3], 0);
|
||||
sqliteRunParser(&sParse, argv[3], 0);
|
||||
}else{
|
||||
/* If the SQL column is blank it means this is an index that
|
||||
** was created to be the PRIMARY KEY or to fulfill a UNIQUE
|
||||
|
Reference in New Issue
Block a user