aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-09-08 20:26:09 +0000
committerdrh <drh@noemail.net>2015-09-08 20:26:09 +0000
commitb4d472f609d0f81bec921b82251f0a6c23a26ece (patch)
tree15e57f610cb2387252b8ac63680416d4e25e726c /src
parent310a8d666872b205ccf8cdd5ecbf3ebbcec92b71 (diff)
downloadsqlite-b4d472f609d0f81bec921b82251f0a6c23a26ece.tar.gz
sqlite-b4d472f609d0f81bec921b82251f0a6c23a26ece.zip
Eponymous virtual tables exist in the "main" schema only. Enforce this rule.
FossilOrigin-Name: 06f90bb274c4bb0c30585024c8d365d43c4162f2
Diffstat (limited to 'src')
-rw-r--r--src/build.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/build.c b/src/build.c
index 51facddff..98a032bd7 100644
--- a/src/build.c
+++ b/src/build.c
@@ -357,12 +357,14 @@ Table *sqlite3LocateTable(
if( p==0 ){
const char *zMsg = isView ? "no such view" : "no such table";
#ifndef SQLITE_OMIT_VIRTUALTABLE
- /* If zName is the not the name of a table in the schema created using
- ** CREATE, then check to see if it is the name of an virtual table that
- ** can be an eponymous virtual table. */
- Module *pMod = (Module*)sqlite3HashFind(&pParse->db->aModule, zName);
- if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
- return pMod->pEpoTab;
+ if( sqlite3FindDbName(pParse->db, zDbase)<1 ){
+ /* If zName is the not the name of a table in the schema created using
+ ** CREATE, then check to see if it is the name of an virtual table that
+ ** can be an eponymous virtual table. */
+ Module *pMod = (Module*)sqlite3HashFind(&pParse->db->aModule, zName);
+ if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
+ return pMod->pEpoTab;
+ }
}
#endif
if( zDbase ){