00001 /* 00002 ** 2007 May 7 00003 ** 00004 ** The author disclaims copyright to this source code. In place of 00005 ** a legal notice, here is a blessing: 00006 ** 00007 ** May you do good and not evil. 00008 ** May you find forgiveness for yourself and forgive others. 00009 ** May you share freely, never taking more than you give. 00010 ** 00011 ************************************************************************* 00012 ** 00013 ** This file defines various limits of what SQLite can process. 00014 ** 00015 ** @(#) $Id: sqliteLimit.h,v 1.8 2008/03/26 15:56:22 drh Exp $ 00016 */ 00017 00018 /* 00019 ** The maximum length of a TEXT or BLOB in bytes. This also 00020 ** limits the size of a row in a table or index. 00021 ** 00022 ** The hard limit is the ability of a 32-bit signed integer 00023 ** to count the size: 2^31-1 or 2147483647. 00024 */ 00025 #ifndef SQLITE_MAX_LENGTH 00026 # define SQLITE_MAX_LENGTH 1000000000 00027 #endif 00028 00029 /* 00030 ** This is the maximum number of 00031 ** 00032 ** * Columns in a table 00033 ** * Columns in an index 00034 ** * Columns in a view 00035 ** * Terms in the SET clause of an UPDATE statement 00036 ** * Terms in the result set of a SELECT statement 00037 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. 00038 ** * Terms in the VALUES clause of an INSERT statement 00039 ** 00040 ** The hard upper limit here is 32676. Most database people will 00041 ** tell you that in a well-normalized database, you usually should 00042 ** not have more than a dozen or so columns in any table. And if 00043 ** that is the case, there is no point in having more than a few 00044 ** dozen values in any of the other situations described above. 00045 */ 00046 #ifndef SQLITE_MAX_COLUMN 00047 # define SQLITE_MAX_COLUMN 2000 00048 #endif 00049 00050 /* 00051 ** The maximum length of a single SQL statement in bytes. 00052 ** 00053 ** It used to be the case that setting this value to zero would 00054 ** turn the limit off. That is no longer true. It is not possible 00055 ** to turn this limit off. 00056 */ 00057 #ifndef SQLITE_MAX_SQL_LENGTH 00058 # define SQLITE_MAX_SQL_LENGTH 1000000000 00059 #endif 00060 00061 /* 00062 ** The maximum depth of an expression tree. This is limited to 00063 ** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might 00064 ** want to place more severe limits on the complexity of an 00065 ** expression. 00066 ** 00067 ** A value of 0 used to mean that the limit was not enforced. 00068 ** But that is no longer true. The limit is now strictly enforced 00069 ** at all times. 00070 */ 00071 #ifndef SQLITE_MAX_EXPR_DEPTH 00072 # define SQLITE_MAX_EXPR_DEPTH 1000 00073 #endif 00074 00075 /* 00076 ** The maximum number of terms in a compound SELECT statement. 00077 ** The code generator for compound SELECT statements does one 00078 ** level of recursion for each term. A stack overflow can result 00079 ** if the number of terms is too large. In practice, most SQL 00080 ** never has more than 3 or 4 terms. Use a value of 0 to disable 00081 ** any limit on the number of terms in a compount SELECT. 00082 */ 00083 #ifndef SQLITE_MAX_COMPOUND_SELECT 00084 # define SQLITE_MAX_COMPOUND_SELECT 500 00085 #endif 00086 00087 /* 00088 ** The maximum number of opcodes in a VDBE program. 00089 ** Not currently enforced. 00090 */ 00091 #ifndef SQLITE_MAX_VDBE_OP 00092 # define SQLITE_MAX_VDBE_OP 25000 00093 #endif 00094 00095 /* 00096 ** The maximum number of arguments to an SQL function. 00097 */ 00098 #ifndef SQLITE_MAX_FUNCTION_ARG 00099 # define SQLITE_MAX_FUNCTION_ARG 100 00100 #endif 00101 00102 /* 00103 ** The maximum number of in-memory pages to use for the main database 00104 ** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE 00105 */ 00106 #ifndef SQLITE_DEFAULT_CACHE_SIZE 00107 # define SQLITE_DEFAULT_CACHE_SIZE 2000 00108 #endif 00109 #ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE 00110 # define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500 00111 #endif 00112 00113 /* 00114 ** The maximum number of attached databases. This must be between 0 00115 ** and 30. The upper bound on 30 is because a 32-bit integer bitmap 00116 ** is used internally to track attached databases. 00117 */ 00118 #ifndef SQLITE_MAX_ATTACHED 00119 # define SQLITE_MAX_ATTACHED 10 00120 #endif 00121 00122 00123 /* 00124 ** The maximum value of a ?nnn wildcard that the parser will accept. 00125 */ 00126 #ifndef SQLITE_MAX_VARIABLE_NUMBER 00127 # define SQLITE_MAX_VARIABLE_NUMBER 999 00128 #endif 00129 00130 /* Maximum page size. The upper bound on this value is 32768. This a limit 00131 ** imposed by the necessity of storing the value in a 2-byte unsigned integer 00132 ** and the fact that the page size must be a power of 2. 00133 */ 00134 #ifndef SQLITE_MAX_PAGE_SIZE 00135 # define SQLITE_MAX_PAGE_SIZE 32768 00136 #endif 00137 00138 00139 /* 00140 ** The default size of a database page. 00141 */ 00142 #ifndef SQLITE_DEFAULT_PAGE_SIZE 00143 # define SQLITE_DEFAULT_PAGE_SIZE 1024 00144 #endif 00145 #if SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE 00146 # undef SQLITE_DEFAULT_PAGE_SIZE 00147 # define SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE 00148 #endif 00149 00150 /* 00151 ** Ordinarily, if no value is explicitly provided, SQLite creates databases 00152 ** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain 00153 ** device characteristics (sector-size and atomic write() support), 00154 ** SQLite may choose a larger value. This constant is the maximum value 00155 ** SQLite will choose on its own. 00156 */ 00157 #ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE 00158 # define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192 00159 #endif 00160 #if SQLITE_MAX_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE 00161 # undef SQLITE_MAX_DEFAULT_PAGE_SIZE 00162 # define SQLITE_MAX_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE 00163 #endif 00164 00165 00166 /* 00167 ** Maximum number of pages in one database file. 00168 ** 00169 ** This is really just the default value for the max_page_count pragma. 00170 ** This value can be lowered (or raised) at run-time using that the 00171 ** max_page_count macro. 00172 */ 00173 #ifndef SQLITE_MAX_PAGE_COUNT 00174 # define SQLITE_MAX_PAGE_COUNT 1073741823 00175 #endif 00176 00177 /* 00178 ** Maximum length (in bytes) of the pattern in a LIKE or GLOB 00179 ** operator. 00180 */ 00181 #ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH 00182 # define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000 00183 #endif
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:56 2011 by Doxygen 1.6.1