mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
When creating a new virtual table, ensure that the OP_ParseSchema opcode
processes the correct entry in the sqlite_master table even if there is a second entry with the same name and table values due to database corruption and the use of writable_schema=ON. Dbsqlfuzz find. FossilOrigin-Name: 4dbb6e1cb094f3428c74ea8bdd86ab63341fecce978a062968ca01423f382e90
This commit is contained in:
@@ -484,13 +484,13 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
|
||||
zStmt,
|
||||
pParse->regRowid
|
||||
);
|
||||
sqlite3DbFree(db, zStmt);
|
||||
v = sqlite3GetVdbe(pParse);
|
||||
sqlite3ChangeCookie(pParse, iDb);
|
||||
|
||||
sqlite3VdbeAddOp0(v, OP_Expire);
|
||||
zWhere = sqlite3MPrintf(db, "name='%q' AND type='table'", pTab->zName);
|
||||
zWhere = sqlite3MPrintf(db, "name=%Q AND sql=%Q", pTab->zName, zStmt);
|
||||
sqlite3VdbeAddParseSchemaOp(v, iDb, zWhere);
|
||||
sqlite3DbFree(db, zStmt);
|
||||
|
||||
iReg = ++pParse->nMem;
|
||||
sqlite3VdbeLoadString(v, iReg, pTab->zName);
|
||||
|
Reference in New Issue
Block a user