mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
First the shadow table mechanism so that it works even if the shadow table
comes before the virtual table in the sqlite_schema table, as can happen after a VACUUM. FossilOrigin-Name: 005a8642773556825fe4c5d0b2c12517d35289308a30df0151ef7f080acb0172
This commit is contained in:
14
src/vtab.c
14
src/vtab.c
@@ -505,18 +505,14 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
|
||||
iReg = ++pParse->nMem;
|
||||
sqlite3VdbeLoadString(v, iReg, pTab->zName);
|
||||
sqlite3VdbeAddOp2(v, OP_VCreate, iDb, iReg);
|
||||
}
|
||||
|
||||
/* If we are rereading the sqlite_schema table create the in-memory
|
||||
** record of the table. The xConnect() method is not called until
|
||||
** the first time the virtual table is used in an SQL statement. This
|
||||
** allows a schema that contains virtual tables to be loaded before
|
||||
** the required virtual table implementations are registered. */
|
||||
else {
|
||||
}else{
|
||||
/* If we are rereading the sqlite_schema table create the in-memory
|
||||
** record of the table. */
|
||||
Table *pOld;
|
||||
Schema *pSchema = pTab->pSchema;
|
||||
const char *zName = pTab->zName;
|
||||
assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
|
||||
assert( zName!=0 );
|
||||
sqlite3MarkAllShadowTablesOf(db, pTab);
|
||||
pOld = sqlite3HashInsert(&pSchema->tblHash, zName, pTab);
|
||||
if( pOld ){
|
||||
sqlite3OomFault(db);
|
||||
|
Reference in New Issue
Block a user