aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2022-04-15 15:47:14 +0000
committerdrh <>2022-04-15 15:47:14 +0000
commita99e325468d0c46919cf8a88f7c0b5bb8a4987a8 (patch)
tree3d929a2ac23c4e6acd1a1aadd57ed06c39939f28 /src/sqliteInt.h
parent358424aeff71bc8b38053b822091f4c6532ec5b1 (diff)
downloadsqlite-a99e325468d0c46919cf8a88f7c0b5bb8a4987a8.tar.gz
sqlite-a99e325468d0c46919cf8a88f7c0b5bb8a4987a8.zip
Enhance the IdList object to exist in a single memory allocation (rather than
a separate allocate for the base object and the array of IDs). Also permit an IdList object to store an Expr pointer together with each name. FossilOrigin-Name: 40f3c95871e6f40f287ef2756abafb8fc56dffdd0af69436e5c7d8e95022d94e
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 1cd3e75b4..3a9d8b8a0 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3038,14 +3038,26 @@ struct ExprList {
** If "a" is the k-th column of table "t", then IdList.a[0].idx==k.
*/
struct IdList {
+ int nId; /* Number of identifiers on the list */
+ u8 eU4; /* Which element of a.u4 is valid */
struct IdList_item {
char *zName; /* Name of the identifier */
- int idx; /* Index in some Table.aCol[] of a column named zName */
- } *a;
- int nId; /* Number of identifiers on the list */
+ union {
+ int idx; /* Index in some Table.aCol[] of a column named zName */
+ Expr *pExpr; /* Expr to implement a USING variable */
+ } u4;
+ } a[1];
};
/*
+** Allowed values for IdList.eType, which determines which value of the a.u4
+** is valid.
+*/
+#define EU4_NONE 0 /* Does not use IdList.a.u4 */
+#define EU4_IDX 1 /* Uses IdList.a.u4.idx */
+#define EU4_EXPR 2 /* Uses IdList.a.u4.pExpr */
+
+/*
** The SrcItem object represents a single term in the FROM clause of a query.
** The SrcList object is mostly an array of SrcItems.
**