mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
An experimental branch with code that allows virtual tables to be declared
as WITHOUT ROWID tables. This might be useful for virtual tables that model external data sources that do not have a convenient way of computing a unique rowid. The current check-in almost works, but there are still serious issues. FossilOrigin-Name: 49638f180e26477974cacc69b79e0be0a5e18b29
This commit is contained in:
12
src/vtab.c
12
src/vtab.c
@@ -754,10 +754,14 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
|
||||
&& (pParse->pNewTable->tabFlags & TF_Virtual)==0
|
||||
){
|
||||
if( !pTab->aCol ){
|
||||
pTab->aCol = pParse->pNewTable->aCol;
|
||||
pTab->nCol = pParse->pNewTable->nCol;
|
||||
pParse->pNewTable->nCol = 0;
|
||||
pParse->pNewTable->aCol = 0;
|
||||
Table *pNew = pParse->pNewTable;
|
||||
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;
|
||||
}
|
||||
pCtx->bDeclared = 1;
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user