aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-07-25 22:31:04 +0000
committerdrh <>2022-07-25 22:31:04 +0000
commitef69d2b277c545fa8fe193ab9ec87b96ccbd05f7 (patch)
tree4169d719c620c8438aa7a9230f60bf0fe1b0ac1e /src
parentf89812fe526d29db71fd4181d5efc40b4ced2648 (diff)
downloadsqlite-ef69d2b277c545fa8fe193ab9ec87b96ccbd05f7.tar.gz
sqlite-ef69d2b277c545fa8fe193ab9ec87b96ccbd05f7.zip
Performance optimization in sqlite3ViewGetColumnNames().
FossilOrigin-Name: 390717e68800af9b71acd635cf6cb123f9a591276df511f11462b42960f9a70c
Diffstat (limited to 'src')
-rw-r--r--src/build.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/build.c b/src/build.c
index 4b27d5cf8..47aa8bc57 100644
--- a/src/build.c
+++ b/src/build.c
@@ -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