aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteLimit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sqliteLimit.h')
-rw-r--r--src/sqliteLimit.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sqliteLimit.h b/src/sqliteLimit.h
index 620b0f8e5..ec774889b 100644
--- a/src/sqliteLimit.h
+++ b/src/sqliteLimit.h
@@ -36,14 +36,22 @@
** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement.
** * Terms in the VALUES clause of an INSERT statement
**
-** The hard upper limit here is 32676. Most database people will
+** The hard upper limit here is 32767. Most database people will
** tell you that in a well-normalized database, you usually should
** not have more than a dozen or so columns in any table. And if
** that is the case, there is no point in having more than a few
** dozen values in any of the other situations described above.
+**
+** An index can only have SQLITE_MAX_COLUMN columns from the user
+** point of view, but the underlying b-tree that implements the index
+** might have up to twice as many columns in a WITHOUT ROWID table,
+** since must also store the primary key at the end. Hence the
+** column count for Index is u16 instead of i16.
*/
-#ifndef SQLITE_MAX_COLUMN
+#if !defined(SQLITE_MAX_COLUMN)
# define SQLITE_MAX_COLUMN 2000
+#elif SQLITE_MAX_COLUMN>32767
+# error SQLITE_MAX_COLUMN may not exceed 32767
#endif
/*