aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 158005265..b1b04725a 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1498,6 +1498,22 @@ struct AggInfo {
};
/*
+** The datatype ynVar is a signed integer, either 16-bit or 32-bit.
+** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater
+** than 32767 we have to make it 32-bit. 16-bit is preferred because
+** it uses less memory in the Expr object, which is a big memory user
+** in systems with lots of prepared statements. And few applications
+** need more than about 10 or 20 variables. But some extreme users want
+** to have prepared statements with over 32767 variables, and for them
+** the option is available (at compile-time).
+*/
+#if SQLITE_MAX_VARIABLE_NUMBER<=32767
+typedef i64 ynVar;
+#else
+typedef int ynVar;
+#endif
+
+/*
** Each node of an expression in the parse tree is an instance
** of this structure.
**
@@ -1590,13 +1606,8 @@ struct Expr {
int iTable; /* TK_COLUMN: cursor number of table holding column
** TK_REGISTER: register number
** TK_TRIGGER: 1 -> new, 0 -> old */
-#if SQLITE_MAX_VARIABLE_NUMBER<=32767
- i16 iColumn; /* TK_COLUMN: column index. -1 for rowid.
+ ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
** TK_VARIABLE: variable number (always >= 1). */
-#else
- int iColumn; /* Some users want a lot of variables and are willing
- ** to bear the memory and performance costs. */
-#endif
i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */
u8 flags2; /* Second set of flags. EP2_... */