SQLite Forum

Documentation bug regarding max SQL length
Login

Documentation bug regarding max SQL length

(1) By anonymous on 2021-10-22 18:48:42 [link] [source]

Hi, We recently saw SQLite error code regarding queries being too large. On checking the error code page, the docs mention limit as 1,000,000 (https://www.sqlite.org/rescode.html#toobig)

However the actual limit is 1,000,000,000 as documented here: https://www.sqlite.org/limits.html#max_sql_length, and in the code

https://sqlite.org/src/file?name=src/sqliteLimit.h&ci=trunk

/*
** The maximum length of a single SQL statement in bytes.
**
** It used to be the case that setting this value to zero would
** turn the limit off.  That is no longer true.  It is not possible
** to turn this limit off.
*/
#ifndef SQLITE_MAX_SQL_LENGTH
# define SQLITE_MAX_SQL_LENGTH 1000000000
#endif

Wanted to confirm that this indeed is just a documentation issue, and I'm not misreading the default value.

Regards, Kanishka

(2) By Larry Brasfield (larrybr) on 2021-10-22 20:07:18 in reply to 1 [source]

As you say, it is just a doc issue. The discrepancy is now corrected. Thanks.