1
0
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:
drh
2016-06-02 16:22:53 +00:00
parent 62340f8498
commit 273bfe9f20
4 changed files with 21 additions and 17 deletions

View File

@@ -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{