mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix corner cases in the WITHOUT ROWID virtual table logic.
FossilOrigin-Name: a393bbb972660c1ffcdda923d0f3564ecfcd2f0a
This commit is contained in:
11
src/vtab.c
11
src/vtab.c
@@ -755,13 +755,20 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
|
||||
){
|
||||
if( !pTab->aCol ){
|
||||
Table *pNew = pParse->pNewTable;
|
||||
Index *pIdx;
|
||||
pTab->aCol = pNew->aCol;
|
||||
pTab->nCol = pNew->nCol;
|
||||
pTab->tabFlags |= pNew->tabFlags & TF_WithoutRowid;
|
||||
pTab->pIndex = pNew->pIndex;
|
||||
pNew->nCol = 0;
|
||||
pNew->aCol = 0;
|
||||
pNew->pIndex = 0;
|
||||
assert( pTab->pIndex==0 );
|
||||
pIdx = pNew->pIndex;
|
||||
if( pIdx ){
|
||||
assert( pIdx->pNext==0 );
|
||||
pTab->pIndex = pIdx;
|
||||
pNew->pIndex = 0;
|
||||
pIdx->pTable = pTab;
|
||||
}
|
||||
}
|
||||
pCtx->bDeclared = 1;
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user