Blame src/sqliteLimit.h

Packit 87b942
/*
Packit 87b942
** 2007 May 7
Packit 87b942
**
Packit 87b942
** The author disclaims copyright to this source code.  In place of
Packit 87b942
** a legal notice, here is a blessing:
Packit 87b942
**
Packit 87b942
**    May you do good and not evil.
Packit 87b942
**    May you find forgiveness for yourself and forgive others.
Packit 87b942
**    May you share freely, never taking more than you give.
Packit 87b942
**
Packit 87b942
*************************************************************************
Packit 87b942
** 
Packit 87b942
** This file defines various limits of what SQLite can process.
Packit 87b942
*/
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum length of a TEXT or BLOB in bytes.   This also
Packit 87b942
** limits the size of a row in a table or index.
Packit 87b942
**
Packit 87b942
** The hard limit is the ability of a 32-bit signed integer
Packit 87b942
** to count the size: 2^31-1 or 2147483647.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_LENGTH
Packit 87b942
# define SQLITE_MAX_LENGTH 1000000000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** This is the maximum number of
Packit 87b942
**
Packit 87b942
**    * Columns in a table
Packit 87b942
**    * Columns in an index
Packit 87b942
**    * Columns in a view
Packit 87b942
**    * Terms in the SET clause of an UPDATE statement
Packit 87b942
**    * Terms in the result set of a SELECT statement
Packit 87b942
**    * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement.
Packit 87b942
**    * Terms in the VALUES clause of an INSERT statement
Packit 87b942
**
Packit 87b942
** The hard upper limit here is 32676.  Most database people will
Packit 87b942
** tell you that in a well-normalized database, you usually should
Packit 87b942
** not have more than a dozen or so columns in any table.  And if
Packit 87b942
** that is the case, there is no point in having more than a few
Packit 87b942
** dozen values in any of the other situations described above.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_COLUMN
Packit 87b942
# define SQLITE_MAX_COLUMN 2000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum length of a single SQL statement in bytes.
Packit 87b942
**
Packit 87b942
** It used to be the case that setting this value to zero would
Packit 87b942
** turn the limit off.  That is no longer true.  It is not possible
Packit 87b942
** to turn this limit off.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_SQL_LENGTH
Packit 87b942
# define SQLITE_MAX_SQL_LENGTH 1000000000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum depth of an expression tree. This is limited to 
Packit 87b942
** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might 
Packit 87b942
** want to place more severe limits on the complexity of an 
Packit 87b942
** expression.
Packit 87b942
**
Packit 87b942
** A value of 0 used to mean that the limit was not enforced.
Packit 87b942
** But that is no longer true.  The limit is now strictly enforced
Packit 87b942
** at all times.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_EXPR_DEPTH
Packit 87b942
# define SQLITE_MAX_EXPR_DEPTH 1000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum number of terms in a compound SELECT statement.
Packit 87b942
** The code generator for compound SELECT statements does one
Packit 87b942
** level of recursion for each term.  A stack overflow can result
Packit 87b942
** if the number of terms is too large.  In practice, most SQL
Packit 87b942
** never has more than 3 or 4 terms.  Use a value of 0 to disable
Packit 87b942
** any limit on the number of terms in a compount SELECT.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_COMPOUND_SELECT
Packit 87b942
# define SQLITE_MAX_COMPOUND_SELECT 500
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum number of opcodes in a VDBE program.
Packit 87b942
** Not currently enforced.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_VDBE_OP
Packit 87b942
# define SQLITE_MAX_VDBE_OP 250000000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum number of arguments to an SQL function.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_FUNCTION_ARG
Packit 87b942
# define SQLITE_MAX_FUNCTION_ARG 127
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The suggested maximum number of in-memory pages to use for
Packit 87b942
** the main database table and for temporary tables.
Packit 87b942
**
Packit 87b942
** IMPLEMENTATION-OF: R-30185-15359 The default suggested cache size is -2000,
Packit 87b942
** which means the cache size is limited to 2048000 bytes of memory.
Packit 87b942
** IMPLEMENTATION-OF: R-48205-43578 The default suggested cache size can be
Packit 87b942
** altered using the SQLITE_DEFAULT_CACHE_SIZE compile-time options.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_DEFAULT_CACHE_SIZE
Packit 87b942
# define SQLITE_DEFAULT_CACHE_SIZE  -2000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The default number of frames to accumulate in the log file before
Packit 87b942
** checkpointing the database in WAL mode.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_DEFAULT_WAL_AUTOCHECKPOINT
Packit 87b942
# define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT  1000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum number of attached databases.  This must be between 0
Packit 87b942
** and 125.  The upper bound of 125 is because the attached databases are
Packit 87b942
** counted using a signed 8-bit integer which has a maximum value of 127
Packit 87b942
** and we have to allow 2 extra counts for the "main" and "temp" databases.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_ATTACHED
Packit 87b942
# define SQLITE_MAX_ATTACHED 10
Packit 87b942
#endif
Packit 87b942
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The maximum value of a ?nnn wildcard that the parser will accept.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_VARIABLE_NUMBER
Packit 87b942
# define SQLITE_MAX_VARIABLE_NUMBER 999
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/* Maximum page size.  The upper bound on this value is 65536.  This a limit
Packit 87b942
** imposed by the use of 16-bit offsets within each page.
Packit 87b942
**
Packit 87b942
** Earlier versions of SQLite allowed the user to change this value at
Packit 87b942
** compile time. This is no longer permitted, on the grounds that it creates
Packit 87b942
** a library that is technically incompatible with an SQLite library 
Packit 87b942
** compiled with a different limit. If a process operating on a database 
Packit 87b942
** with a page-size of 65536 bytes crashes, then an instance of SQLite 
Packit 87b942
** compiled with the default page-size limit will not be able to rollback 
Packit 87b942
** the aborted transaction. This could lead to database corruption.
Packit 87b942
*/
Packit 87b942
#ifdef SQLITE_MAX_PAGE_SIZE
Packit 87b942
# undef SQLITE_MAX_PAGE_SIZE
Packit 87b942
#endif
Packit 87b942
#define SQLITE_MAX_PAGE_SIZE 65536
Packit 87b942
Packit 87b942
Packit 87b942
/*
Packit 87b942
** The default size of a database page.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_DEFAULT_PAGE_SIZE
Packit 87b942
# define SQLITE_DEFAULT_PAGE_SIZE 4096
Packit 87b942
#endif
Packit 87b942
#if SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE
Packit 87b942
# undef SQLITE_DEFAULT_PAGE_SIZE
Packit 87b942
# define SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** Ordinarily, if no value is explicitly provided, SQLite creates databases
Packit 87b942
** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain
Packit 87b942
** device characteristics (sector-size and atomic write() support),
Packit 87b942
** SQLite may choose a larger value. This constant is the maximum value
Packit 87b942
** SQLite will choose on its own.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE
Packit 87b942
# define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192
Packit 87b942
#endif
Packit 87b942
#if SQLITE_MAX_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE
Packit 87b942
# undef SQLITE_MAX_DEFAULT_PAGE_SIZE
Packit 87b942
# define SQLITE_MAX_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE
Packit 87b942
#endif
Packit 87b942
Packit 87b942
Packit 87b942
/*
Packit 87b942
** Maximum number of pages in one database file.
Packit 87b942
**
Packit 87b942
** This is really just the default value for the max_page_count pragma.
Packit 87b942
** This value can be lowered (or raised) at run-time using that the
Packit 87b942
** max_page_count macro.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_PAGE_COUNT
Packit 87b942
# define SQLITE_MAX_PAGE_COUNT 1073741823
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** Maximum length (in bytes) of the pattern in a LIKE or GLOB
Packit 87b942
** operator.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH
Packit 87b942
# define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** Maximum depth of recursion for triggers.
Packit 87b942
**
Packit 87b942
** A value of 1 means that a trigger program will not be able to itself
Packit 87b942
** fire any triggers. A value of 0 means that no trigger programs at all 
Packit 87b942
** may be executed.
Packit 87b942
*/
Packit 87b942
#ifndef SQLITE_MAX_TRIGGER_DEPTH
Packit 87b942
# define SQLITE_MAX_TRIGGER_DEPTH 1000
Packit 87b942
#endif