ds@1952: /* ds@1952: ** 2007 May 7 ds@1952: ** ds@1952: ** The author disclaims copyright to this source code. In place of ds@1952: ** a legal notice, here is a blessing: ds@1952: ** ds@1952: ** May you do good and not evil. ds@1952: ** May you find forgiveness for yourself and forgive others. ds@1952: ** May you share freely, never taking more than you give. ds@1952: ** ds@1952: ************************************************************************* ds@1952: ** ds@1952: ** This file defines various limits of what SQLite can process. ds@1952: ** ds@1952: ** @(#) $Id$ ds@1952: */ ds@1952: ds@1952: /* ds@1952: ** The maximum length of a TEXT or BLOB in bytes. This also ds@1952: ** limits the size of a row in a table or index. ds@1952: ** ds@1952: ** The hard limit is the ability of a 32-bit signed integer ds@1952: ** to count the size: 2^31-1 or 2147483647. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_LENGTH ds@1952: # define SQLITE_MAX_LENGTH 1000000000 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** This is the maximum number of ds@1952: ** ds@1952: ** * Columns in a table ds@1952: ** * Columns in an index ds@1952: ** * Columns in a view ds@1952: ** * Terms in the SET clause of an UPDATE statement ds@1952: ** * Terms in the result set of a SELECT statement ds@1952: ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ds@1952: ** * Terms in the VALUES clause of an INSERT statement ds@1952: ** ds@1952: ** The hard upper limit here is 32676. Most database people will ds@1952: ** tell you that in a well-normalized database, you usually should ds@1952: ** not have more than a dozen or so columns in any table. And if ds@1952: ** that is the case, there is no point in having more than a few ds@1952: ** dozen values in any of the other situations described above. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_COLUMN ds@1952: # define SQLITE_MAX_COLUMN 2000 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum length of a single SQL statement in bytes. ds@1952: ** The hard limit here is the same as SQLITE_MAX_LENGTH. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_SQL_LENGTH ds@1952: # define SQLITE_MAX_SQL_LENGTH 1000000 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum depth of an expression tree. This is limited to ds@1952: ** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might ds@1952: ** want to place more severe limits on the complexity of an ds@1952: ** expression. A value of 0 (the default) means do not enforce ds@1952: ** any limitation on expression tree depth. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_EXPR_DEPTH ds@1952: # define SQLITE_MAX_EXPR_DEPTH 1000 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum number of terms in a compound SELECT statement. ds@1952: ** The code generator for compound SELECT statements does one ds@1952: ** level of recursion for each term. A stack overflow can result ds@1952: ** if the number of terms is too large. In practice, most SQL ds@1952: ** never has more than 3 or 4 terms. Use a value of 0 to disable ds@1952: ** any limit on the number of terms in a compount SELECT. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_COMPOUND_SELECT ds@1952: # define SQLITE_MAX_COMPOUND_SELECT 500 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum number of opcodes in a VDBE program. ds@1952: ** Not currently enforced. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_VDBE_OP ds@1952: # define SQLITE_MAX_VDBE_OP 25000 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum number of arguments to an SQL function. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_FUNCTION_ARG ds@1952: # define SQLITE_MAX_FUNCTION_ARG 100 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum number of in-memory pages to use for the main database ds@1952: ** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE ds@1952: */ ds@1952: #ifndef SQLITE_DEFAULT_CACHE_SIZE ds@1952: # define SQLITE_DEFAULT_CACHE_SIZE 2000 ds@1952: #endif ds@1952: #ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE ds@1952: # define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The maximum number of attached databases. This must be at least 2 ds@1952: ** in order to support the main database file (0) and the file used to ds@1952: ** hold temporary tables (1). And it must be less than 32 because ds@1952: ** we use a bitmask of databases with a u32 in places (for example ds@1952: ** the Parse.cookieMask field). ds@1952: */ ds@1952: #ifndef SQLITE_MAX_ATTACHED ds@1952: # define SQLITE_MAX_ATTACHED 10 ds@1952: #endif ds@1952: ds@1952: ds@1952: /* ds@1952: ** The maximum value of a ?nnn wildcard that the parser will accept. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_VARIABLE_NUMBER ds@1952: # define SQLITE_MAX_VARIABLE_NUMBER 999 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** The default size of a database page. ds@1952: */ ds@1952: #ifndef SQLITE_DEFAULT_PAGE_SIZE ds@1952: # define SQLITE_DEFAULT_PAGE_SIZE 1024 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** Ordinarily, if no value is explicitly provided, SQLite creates databases ds@1952: ** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain ds@1952: ** device characteristics (sector-size and atomic write() support), ds@1952: ** SQLite may choose a larger value. This constant is the maximum value ds@1952: ** SQLite will choose on it's own. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE ds@1952: # define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192 ds@1952: #endif ds@1952: ds@1952: /* Maximum page size. The upper bound on this value is 32768. This a limit ds@1952: ** imposed by the necessity of storing the value in a 2-byte unsigned integer ds@1952: ** and the fact that the page size must be a power of 2. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_PAGE_SIZE ds@1952: # define SQLITE_MAX_PAGE_SIZE 32768 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** Maximum number of pages in one database file. ds@1952: ** ds@1952: ** This is really just the default value for the max_page_count pragma. ds@1952: ** This value can be lowered (or raised) at run-time using that the ds@1952: ** max_page_count macro. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_PAGE_COUNT ds@1952: # define SQLITE_MAX_PAGE_COUNT 1073741823 ds@1952: #endif ds@1952: ds@1952: /* ds@1952: ** Maximum length (in bytes) of the pattern in a LIKE or GLOB ds@1952: ** operator. ds@1952: */ ds@1952: #ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH ds@1952: # define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000 ds@1952: #endif