diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/alter.c | 6 | ||||
-rw-r--r-- | src/sqliteInt.h | 1 | ||||
-rw-r--r-- | src/vtab.c | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/alter.c b/src/alter.c index d3fe6bf2e..32a472943 100644 --- a/src/alter.c +++ b/src/alter.c @@ -29,8 +29,9 @@ ** Or, if zName is not a system table, zero is returned. */ static int isAlterableTable(Parse *pParse, Table *pTab){ - if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) + if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) #ifndef SQLITE_OMIT_VIRTUALTABLE + || (pTab->tabFlags & TF_Eponymous)!=0 || ( (pTab->tabFlags & TF_Shadow)!=0 && sqlite3ReadOnlyShadowTables(pParse->db) ) @@ -918,8 +919,7 @@ static RenameToken *renameTokenFind( void *pPtr ){ RenameToken **pp; - if( pPtr==0 ){ - assert( pParse->nErr || pParse->db->mallocFailed ); + if( NEVER(pPtr==0) ){ return 0; } for(pp=&pParse->pRename; (*pp); pp=&(*pp)->pNext){ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 21c6f6f30..b8b6b340d 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2236,6 +2236,7 @@ struct Table { #define TF_Shadow 0x1000 /* True for a shadow table */ #define TF_HasStat4 0x2000 /* STAT4 info available for this table */ #define TF_Ephemeral 0x4000 /* An ephemeral table */ +#define TF_Eponymous 0x8000 /* An eponymous virtual table */ /* ** Test to see whether or not a table is a virtual table. This is diff --git a/src/vtab.c b/src/vtab.c index ded12c13b..c9dcadae4 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -1221,6 +1221,7 @@ int sqlite3VtabEponymousTableInit(Parse *pParse, Module *pMod){ pTab->pSchema = db->aDb[0].pSchema; assert( pTab->nModuleArg==0 ); pTab->iPKey = -1; + pTab->tabFlags |= TF_Eponymous; addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName)); addModuleArgument(pParse, pTab, 0); addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName)); |