1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Do not allow table-valued function syntax to be used on a view.

FossilOrigin-Name: 97cfe346e140e42a604375551f8168276bdbea11
This commit is contained in:
drh
2015-09-19 20:27:08 +00:00
parent b97ad0297c
commit 6230212f4a
4 changed files with 27 additions and 9 deletions

View File

@@ -4267,9 +4267,12 @@ static int selectExpander(Walker *pWalker, Select *p){
pTab->nRef++;
#if !defined(SQLITE_OMIT_VIEW) || !defined (SQLITE_OMIT_VIRTUALTABLE)
if( pTab->pSelect || IsVirtual(pTab) ){
/* We reach here if the named table is a really a view */
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
assert( pFrom->pSelect==0 );
if( pFrom->fg.isTabFunc && !IsVirtual(pTab) ){
sqlite3ErrorMsg(pParse, "'%s' is not a function", pTab->zName);
return WRC_Abort;
}
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
sqlite3SelectSetName(pFrom->pSelect, pTab->zName);
sqlite3WalkSelect(pWalker, pFrom->pSelect);