extensions/sqlite/sqlite-source/sqliteLimit.h
author Scott Ehlert <ds@alliedmods.net>
Sun Sep 14 02:59:26 2008 -0500 (2008-09-14)
changeset 2288 15c77b21589a
parent 1952 b7aa2b626807
permissions -rw-r--r--
Eliminated head for dead branch: refac-jit
ds@1952
     1
/*
ds@1952
     2
** 2007 May 7
ds@1952
     3
**
ds@1952
     4
** The author disclaims copyright to this source code.  In place of
ds@1952
     5
** a legal notice, here is a blessing:
ds@1952
     6
**
ds@1952
     7
**    May you do good and not evil.
ds@1952
     8
**    May you find forgiveness for yourself and forgive others.
ds@1952
     9
**    May you share freely, never taking more than you give.
ds@1952
    10
**
ds@1952
    11
*************************************************************************
ds@1952
    12
** 
ds@1952
    13
** This file defines various limits of what SQLite can process.
ds@1952
    14
**
ds@1952
    15
** @(#) $Id$
ds@1952
    16
*/
ds@1952
    17
ds@1952
    18
/*
ds@1952
    19
** The maximum length of a TEXT or BLOB in bytes.   This also
ds@1952
    20
** limits the size of a row in a table or index.
ds@1952
    21
**
ds@1952
    22
** The hard limit is the ability of a 32-bit signed integer
ds@1952
    23
** to count the size: 2^31-1 or 2147483647.
ds@1952
    24
*/
ds@1952
    25
#ifndef SQLITE_MAX_LENGTH
ds@1952
    26
# define SQLITE_MAX_LENGTH 1000000000
ds@1952
    27
#endif
ds@1952
    28
ds@1952
    29
/*
ds@1952
    30
** This is the maximum number of
ds@1952
    31
**
ds@1952
    32
**    * Columns in a table
ds@1952
    33
**    * Columns in an index
ds@1952
    34
**    * Columns in a view
ds@1952
    35
**    * Terms in the SET clause of an UPDATE statement
ds@1952
    36
**    * Terms in the result set of a SELECT statement
ds@1952
    37
**    * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement.
ds@1952
    38
**    * Terms in the VALUES clause of an INSERT statement
ds@1952
    39
**
ds@1952
    40
** The hard upper limit here is 32676.  Most database people will
ds@1952
    41
** tell you that in a well-normalized database, you usually should
ds@1952
    42
** not have more than a dozen or so columns in any table.  And if
ds@1952
    43
** that is the case, there is no point in having more than a few
ds@1952
    44
** dozen values in any of the other situations described above.
ds@1952
    45
*/
ds@1952
    46
#ifndef SQLITE_MAX_COLUMN
ds@1952
    47
# define SQLITE_MAX_COLUMN 2000
ds@1952
    48
#endif
ds@1952
    49
ds@1952
    50
/*
ds@1952
    51
** The maximum length of a single SQL statement in bytes.
ds@1952
    52
** The hard limit here is the same as SQLITE_MAX_LENGTH.
ds@1952
    53
*/
ds@1952
    54
#ifndef SQLITE_MAX_SQL_LENGTH
ds@1952
    55
# define SQLITE_MAX_SQL_LENGTH 1000000
ds@1952
    56
#endif
ds@1952
    57
ds@1952
    58
/*
ds@1952
    59
** The maximum depth of an expression tree. This is limited to 
ds@1952
    60
** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might 
ds@1952
    61
** want to place more severe limits on the complexity of an 
ds@1952
    62
** expression. A value of 0 (the default) means do not enforce
ds@1952
    63
** any limitation on expression tree depth.
ds@1952
    64
*/
ds@1952
    65
#ifndef SQLITE_MAX_EXPR_DEPTH
ds@1952
    66
# define SQLITE_MAX_EXPR_DEPTH 1000
ds@1952
    67
#endif
ds@1952
    68
ds@1952
    69
/*
ds@1952
    70
** The maximum number of terms in a compound SELECT statement.
ds@1952
    71
** The code generator for compound SELECT statements does one
ds@1952
    72
** level of recursion for each term.  A stack overflow can result
ds@1952
    73
** if the number of terms is too large.  In practice, most SQL
ds@1952
    74
** never has more than 3 or 4 terms.  Use a value of 0 to disable
ds@1952
    75
** any limit on the number of terms in a compount SELECT.
ds@1952
    76
*/
ds@1952
    77
#ifndef SQLITE_MAX_COMPOUND_SELECT
ds@1952
    78
# define SQLITE_MAX_COMPOUND_SELECT 500
ds@1952
    79
#endif
ds@1952
    80
ds@1952
    81
/*
ds@1952
    82
** The maximum number of opcodes in a VDBE program.
ds@1952
    83
** Not currently enforced.
ds@1952
    84
*/
ds@1952
    85
#ifndef SQLITE_MAX_VDBE_OP
ds@1952
    86
# define SQLITE_MAX_VDBE_OP 25000
ds@1952
    87
#endif
ds@1952
    88
ds@1952
    89
/*
ds@1952
    90
** The maximum number of arguments to an SQL function.
ds@1952
    91
*/
ds@1952
    92
#ifndef SQLITE_MAX_FUNCTION_ARG
ds@1952
    93
# define SQLITE_MAX_FUNCTION_ARG 100
ds@1952
    94
#endif
ds@1952
    95
ds@1952
    96
/*
ds@1952
    97
** The maximum number of in-memory pages to use for the main database
ds@1952
    98
** table and for temporary tables.  The SQLITE_DEFAULT_CACHE_SIZE
ds@1952
    99
*/
ds@1952
   100
#ifndef SQLITE_DEFAULT_CACHE_SIZE
ds@1952
   101
# define SQLITE_DEFAULT_CACHE_SIZE  2000
ds@1952
   102
#endif
ds@1952
   103
#ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE
ds@1952
   104
# define SQLITE_DEFAULT_TEMP_CACHE_SIZE  500
ds@1952
   105
#endif
ds@1952
   106
ds@1952
   107
/*
ds@1952
   108
** The maximum number of attached databases.  This must be at least 2
ds@1952
   109
** in order to support the main database file (0) and the file used to
ds@1952
   110
** hold temporary tables (1).  And it must be less than 32 because
ds@1952
   111
** we use a bitmask of databases with a u32 in places (for example
ds@1952
   112
** the Parse.cookieMask field).
ds@1952
   113
*/
ds@1952
   114
#ifndef SQLITE_MAX_ATTACHED
ds@1952
   115
# define SQLITE_MAX_ATTACHED 10
ds@1952
   116
#endif
ds@1952
   117
ds@1952
   118
ds@1952
   119
/*
ds@1952
   120
** The maximum value of a ?nnn wildcard that the parser will accept.
ds@1952
   121
*/
ds@1952
   122
#ifndef SQLITE_MAX_VARIABLE_NUMBER
ds@1952
   123
# define SQLITE_MAX_VARIABLE_NUMBER 999
ds@1952
   124
#endif
ds@1952
   125
ds@1952
   126
/*
ds@1952
   127
** The default size of a database page.
ds@1952
   128
*/
ds@1952
   129
#ifndef SQLITE_DEFAULT_PAGE_SIZE
ds@1952
   130
# define SQLITE_DEFAULT_PAGE_SIZE 1024
ds@1952
   131
#endif
ds@1952
   132
ds@1952
   133
/*
ds@1952
   134
** Ordinarily, if no value is explicitly provided, SQLite creates databases
ds@1952
   135
** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain
ds@1952
   136
** device characteristics (sector-size and atomic write() support),
ds@1952
   137
** SQLite may choose a larger value. This constant is the maximum value
ds@1952
   138
** SQLite will choose on it's own.
ds@1952
   139
*/
ds@1952
   140
#ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE
ds@1952
   141
# define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192
ds@1952
   142
#endif
ds@1952
   143
ds@1952
   144
/* Maximum page size.  The upper bound on this value is 32768.  This a limit
ds@1952
   145
** imposed by the necessity of storing the value in a 2-byte unsigned integer
ds@1952
   146
** and the fact that the page size must be a power of 2.
ds@1952
   147
*/
ds@1952
   148
#ifndef SQLITE_MAX_PAGE_SIZE
ds@1952
   149
# define SQLITE_MAX_PAGE_SIZE 32768
ds@1952
   150
#endif
ds@1952
   151
ds@1952
   152
/*
ds@1952
   153
** Maximum number of pages in one database file.
ds@1952
   154
**
ds@1952
   155
** This is really just the default value for the max_page_count pragma.
ds@1952
   156
** This value can be lowered (or raised) at run-time using that the
ds@1952
   157
** max_page_count macro.
ds@1952
   158
*/
ds@1952
   159
#ifndef SQLITE_MAX_PAGE_COUNT
ds@1952
   160
# define SQLITE_MAX_PAGE_COUNT 1073741823
ds@1952
   161
#endif
ds@1952
   162
ds@1952
   163
/*
ds@1952
   164
** Maximum length (in bytes) of the pattern in a LIKE or GLOB
ds@1952
   165
** operator.
ds@1952
   166
*/
ds@1952
   167
#ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH
ds@1952
   168
# define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000
ds@1952
   169
#endif