aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2021-02-22 03:04:25 +0000
committerdrh <>2021-02-22 03:04:25 +0000
commit745912efac43f53e9508db41c38987a47f3939e0 (patch)
treeb6a2fd93aa1f41c237ce9d2dd67aa28b24088cef /src/sqliteInt.h
parenta79e2a2d28eab71b7434a77ada3af5c2855d9bef (diff)
downloadsqlite-745912efac43f53e9508db41c38987a47f3939e0.tar.gz
sqlite-745912efac43f53e9508db41c38987a47f3939e0.zip
Add the AS MATERIALIZED and AS NOT MATERIALIZED syntax that works like it
does in PostgreSQL. FossilOrigin-Name: a6bb272ec0c758ab069bfc07443624e0ea7910b1f23224ee078d050fa3ccf068
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index ea6ff1381..c2db0f8b6 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3895,9 +3895,17 @@ struct Cte {
Select *pSelect; /* The definition of this CTE */
const char *zCteErr; /* Error message for circular references */
CteUse *pUse; /* Usage information for this CTE */
+ u8 eM10d; /* The MATERIALIZED flag */
};
/*
+** Allowed values for the materialized flag (eM10d):
+*/
+#define M10d_Yes 0 /* AS MATERIALIZED */
+#define M10d_Any 1 /* Not specified. Query planner's choice */
+#define M10d_No 2 /* AS NOT MATERIALIZED */
+
+/*
** An instance of the With object represents a WITH clause containing
** one or more CTEs (common table expressions).
*/
@@ -3924,6 +3932,7 @@ struct CteUse {
int regRtn; /* Return address register for addrM9e subroutine */
int iCur; /* Ephemeral table holding the materialization */
LogEst nRowEst; /* Estimated number of rows in the table */
+ u8 eM10d; /* The MATERIALIZED flag */
};
@@ -4930,7 +4939,7 @@ const char *sqlite3JournalModename(int);
int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
#endif
#ifndef SQLITE_OMIT_CTE
- Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*);
+ Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*,u8);
void sqlite3CteDelete(sqlite3*,Cte*);
With *sqlite3WithAdd(Parse*,With*,Cte*);
void sqlite3WithDelete(sqlite3*,With*);