aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-02-12 20:50:20 +0000
committerdrh <drh@noemail.net>2020-02-12 20:50:20 +0000
commitefdba1a8b3c6c967e7fae9c1989c40d420ce64cc (patch)
tree44f82f3b666a9058d3a831334cc4b42bcf68e150 /src
parent41aa442cf4fd66cafbc37f3a1718aeb4c498a96f (diff)
downloadsqlite-efdba1a8b3c6c967e7fae9c1989c40d420ce64cc.tar.gz
sqlite-efdba1a8b3c6c967e7fae9c1989c40d420ce64cc.zip
Increase the default upper bound on the number of parameters in a single
SQL statement to 32766 (from 999). FossilOrigin-Name: 2def75693a8ae002375aff80db0e6c970c75f75e8b6ba64f2c518712badb0ae8
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in2
-rw-r--r--src/sqliteInt.h4
-rw-r--r--src/sqliteLimit.h5
3 files changed, 7 insertions, 4 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 367242bf2..0537ab69f 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -4199,7 +4199,7 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_bind_parameter_index()] API if desired. ^The index
** for "?NNN" parameters is the value of NNN.
** ^The NNN value must be between 1 and the [sqlite3_limit()]
-** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999).
+** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766).
**
** ^The third argument is the value to bind to the parameter.
** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16()
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 76b37cb69..4040f01a4 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2512,10 +2512,10 @@ struct AggInfo {
** 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
+** to have prepared statements with over 32766 variables, and for them
** the option is available (at compile-time).
*/
-#if SQLITE_MAX_VARIABLE_NUMBER<=32767
+#if SQLITE_MAX_VARIABLE_NUMBER<32767
typedef i16 ynVar;
#else
typedef int ynVar;
diff --git a/src/sqliteLimit.h b/src/sqliteLimit.h
index 28e7a41cc..a7302575c 100644
--- a/src/sqliteLimit.h
+++ b/src/sqliteLimit.h
@@ -131,9 +131,12 @@
/*
** The maximum value of a ?nnn wildcard that the parser will accept.
+** If the value exceeds 32767 then extra space is required for the Expr
+** structure. But otherwise, we believe that the number can be as large
+** as a signed 32-bit integer can hold.
*/
#ifndef SQLITE_MAX_VARIABLE_NUMBER
-# define SQLITE_MAX_VARIABLE_NUMBER 999
+# define SQLITE_MAX_VARIABLE_NUMBER 32766
#endif
/* Maximum page size. The upper bound on this value is 65536. This a limit