1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-24 08:21:29 +03:00

Performance optimization in sqlite3ViewGetColumnNames().

FossilOrigin-Name: 390717e68800af9b71acd635cf6cb123f9a591276df511f11462b42960f9a70c
This commit is contained in:
drh
2022-07-25 22:31:04 +00:00
parent f89812fe52
commit ef69d2b277
3 changed files with 13 additions and 8 deletions

View File

@@ -3042,7 +3042,7 @@ create_view_fail:
** the columns of the view in the pTable structure. Return the number
** of errors. If an error is seen leave an error message in pParse->zErrMsg.
*/
int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){
Table *pSelTab; /* A fake table from which we get the result set */
Select *pSel; /* Copy of the SELECT that implements the view */
int nErr = 0; /* Number of errors encountered */
@@ -3165,6 +3165,11 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
#endif /* SQLITE_OMIT_VIEW */
return nErr;
}
int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
assert( pTable!=0 );
if( !IsVirtual(pTable) && pTable->nCol>0 ) return 0;
return viewGetColumnNames(pParse, pTable);
}
#endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */
#ifndef SQLITE_OMIT_VIEW