wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | namespace Community.CsharpSqlite |
2 | { |
||
3 | public partial class Sqlite3 |
||
4 | { |
||
5 | /* |
||
6 | ** 2007 May 7 |
||
7 | ** |
||
8 | ** The author disclaims copyright to this source code. In place of |
||
9 | ** a legal notice, here is a blessing: |
||
10 | ** |
||
11 | ** May you do good and not evil. |
||
12 | ** May you find forgiveness for yourself and forgive others. |
||
13 | ** May you share freely, never taking more than you give. |
||
14 | ** |
||
15 | ************************************************************************* |
||
16 | ** |
||
17 | ** This file defines various limits of what SQLite can process. |
||
18 | ************************************************************************* |
||
19 | ** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart |
||
20 | ** C#-SQLite is an independent reimplementation of the SQLite software library |
||
21 | ** |
||
22 | ** SQLITE_SOURCE_ID: 2011-05-19 13:26:54 ed1da510a239ea767a01dc332b667119fa3c908e |
||
23 | ** |
||
24 | ************************************************************************* |
||
25 | */ |
||
26 | /* |
||
27 | ** The maximum length of a TEXT or BLOB in bytes. This also |
||
28 | ** limits the size of a row in a table or index. |
||
29 | ** |
||
30 | ** The hard limit is the ability of a 32-bit signed integer |
||
31 | ** to count the size: 2^31-1 or 2147483647. |
||
32 | */ |
||
33 | #if !SQLITE_MAX_LENGTH |
||
34 | const int SQLITE_MAX_LENGTH = 1000000000; |
||
35 | #endif |
||
36 | |||
37 | /* |
||
38 | ** This is the maximum number of |
||
39 | ** |
||
40 | ** * Columns in a table |
||
41 | ** * Columns in an index |
||
42 | ** * Columns in a view |
||
43 | ** * Terms in the SET clause of an UPDATE statement |
||
44 | ** * Terms in the result set of a SELECT statement |
||
45 | ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. |
||
46 | ** * Terms in the VALUES clause of an INSERT statement |
||
47 | ** |
||
48 | ** The hard upper limit here is 32676. Most database people will |
||
49 | ** tell you that in a well-normalized database, you usually should |
||
50 | ** not have more than a dozen or so columns in any table. And if |
||
51 | ** that is the case, there is no point in having more than a few |
||
52 | ** dozen values in any of the other situations described above. |
||
53 | */ |
||
54 | #if !SQLITE_MAX_COLUMN |
||
55 | const int SQLITE_MAX_COLUMN = 2000; |
||
56 | #endif |
||
57 | |||
58 | /* |
||
59 | ** The maximum length of a single SQL statement in bytes. |
||
60 | ** |
||
61 | ** It used to be the case that setting this value to zero would |
||
62 | ** turn the limit off. That is no longer true. It is not possible |
||
63 | ** to turn this limit off. |
||
64 | */ |
||
65 | #if !SQLITE_MAX_SQL_LENGTH |
||
66 | const int SQLITE_MAX_SQL_LENGTH = 1000000000; |
||
67 | #endif |
||
68 | |||
69 | /* |
||
70 | ** The maximum depth of an expression tree. This is limited to |
||
71 | ** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might |
||
72 | ** want to place more severe limits on the complexity of an |
||
73 | ** expression. |
||
74 | ** |
||
75 | ** A value of 0 used to mean that the limit was not enforced. |
||
76 | ** But that is no longer true. The limit is now strictly enforced |
||
77 | ** at all times. |
||
78 | */ |
||
79 | #if !SQLITE_MAX_EXPR_DEPTH |
||
80 | const int SQLITE_MAX_EXPR_DEPTH = 1000; |
||
81 | #endif |
||
82 | |||
83 | /* |
||
84 | ** The maximum number of terms in a compound SELECT statement. |
||
85 | ** The code generator for compound SELECT statements does one |
||
86 | ** level of recursion for each term. A stack overflow can result |
||
87 | ** if the number of terms is too large. In practice, most SQL |
||
88 | ** never has more than 3 or 4 terms. Use a value of 0 to disable |
||
89 | ** any limit on the number of terms in a compount SELECT. |
||
90 | */ |
||
91 | #if !SQLITE_MAX_COMPOUND_SELECT |
||
92 | const int SQLITE_MAX_COMPOUND_SELECT = 250; |
||
93 | #endif |
||
94 | |||
95 | /* |
||
96 | ** The maximum number of opcodes in a VDBE program. |
||
97 | ** Not currently enforced. |
||
98 | */ |
||
99 | #if !SQLITE_MAX_VDBE_OP |
||
100 | const int SQLITE_MAX_VDBE_OP = 25000; |
||
101 | #endif |
||
102 | |||
103 | /* |
||
104 | ** The maximum number of arguments to an SQL function. |
||
105 | */ |
||
106 | #if !SQLITE_MAX_FUNCTION_ARG |
||
107 | const int SQLITE_MAX_FUNCTION_ARG = 127;//# define SQLITE_MAX_FUNCTION_ARG 127 |
||
108 | #endif |
||
109 | |||
110 | /* |
||
111 | ** The maximum number of in-memory pages to use for the main database |
||
112 | ** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE |
||
113 | */ |
||
114 | #if !SQLITE_DEFAULT_CACHE_SIZE |
||
115 | const int SQLITE_DEFAULT_CACHE_SIZE = 2000; |
||
116 | #endif |
||
117 | #if !SQLITE_DEFAULT_TEMP_CACHE_SIZE |
||
118 | const int SQLITE_DEFAULT_TEMP_CACHE_SIZE = 500; |
||
119 | #endif |
||
120 | |||
121 | /* |
||
122 | ** The default number of frames to accumulate in the log file before |
||
123 | ** checkpointing the database in WAL mode. |
||
124 | */ |
||
125 | #if !SQLITE_DEFAULT_WAL_AUTOCHECKPOINT |
||
126 | const int SQLITE_DEFAULT_WAL_AUTOCHECKPOINT = 1000; |
||
127 | //# define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000 |
||
128 | #endif |
||
129 | |||
130 | |||
131 | /* |
||
132 | ** The maximum number of attached databases. This must be between 0 |
||
133 | ** and 62. The upper bound on 62 is because a 64-bit integer bitmap |
||
134 | ** is used internally to track attached databases. |
||
135 | */ |
||
136 | #if !SQLITE_MAX_ATTACHED |
||
137 | const int SQLITE_MAX_ATTACHED = 10; |
||
138 | #endif |
||
139 | |||
140 | |||
141 | /* |
||
142 | ** The maximum value of a ?nnn wildcard that the parser will accept. |
||
143 | */ |
||
144 | #if !SQLITE_MAX_VARIABLE_NUMBER |
||
145 | const int SQLITE_MAX_VARIABLE_NUMBER = 999; |
||
146 | #endif |
||
147 | |||
148 | /* Maximum page size. The upper bound on this value is 65536. This a limit |
||
149 | ** imposed by the use of 16-bit offsets within each page. |
||
150 | ** |
||
151 | ** |
||
152 | ** Earlier versions of SQLite allowed the user to change this value at |
||
153 | ** compile time. This is no longer permitted, on the grounds that it creates |
||
154 | ** a library that is technically incompatible with an SQLite library |
||
155 | ** compiled with a different limit. If a process operating on a database |
||
156 | ** with a page-size of 65536 bytes crashes, then an instance of SQLite |
||
157 | ** compiled with the default page-size limit will not be able to rollback |
||
158 | ** the aborted transaction. This could lead to database corruption. |
||
159 | */ |
||
160 | //#if SQLITE_MAX_PAGE_SIZE |
||
161 | //# undef SQLITE_MAX_PAGE_SIZE |
||
162 | //#endif |
||
163 | //#define SQLITE_MAX_PAGE_SIZE 65536 |
||
164 | const int SQLITE_MAX_PAGE_SIZE = 65535; |
||
165 | |||
166 | |||
167 | /* |
||
168 | ** The default size of a database page. |
||
169 | */ |
||
170 | #if !SQLITE_DEFAULT_PAGE_SIZE |
||
171 | const int SQLITE_DEFAULT_PAGE_SIZE = 1024; |
||
172 | #endif |
||
173 | #if SQLITE_DEFAULT_PAGE_SIZE //SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE |
||
174 | //# undef SQLITE_DEFAULT_PAGE_SIZE |
||
175 | const int SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE |
||
176 | #endif |
||
177 | |||
178 | /* |
||
179 | ** Ordinarily, if no value is explicitly provided, SQLite creates databases |
||
180 | ** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain |
||
181 | ** device characteristics (sector-size and atomic write() support), |
||
182 | ** SQLite may choose a larger value. This constant is the maximum value |
||
183 | ** SQLite will choose on its own. |
||
184 | */ |
||
185 | #if !SQLITE_MAX_DEFAULT_PAGE_SIZE |
||
186 | const int SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192; |
||
187 | #endif |
||
188 | #if SQLITE_MAX_DEFAULT_PAGE_SIZE //SQLITE_MAX_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE |
||
189 | //# undef SQLITE_MAX_DEFAULT_PAGE_SIZE |
||
190 | const int SQLITE_MAX_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE |
||
191 | #endif |
||
192 | |||
193 | |||
194 | /* |
||
195 | ** Maximum number of pages in one database file. |
||
196 | ** |
||
197 | ** This is really just the default value for the max_page_count pragma. |
||
198 | ** This value can be lowered (or raised) at run-time using that the |
||
199 | ** max_page_count macro. |
||
200 | */ |
||
201 | #if !SQLITE_MAX_PAGE_COUNT |
||
202 | const int SQLITE_MAX_PAGE_COUNT = 1073741823; |
||
203 | #endif |
||
204 | |||
205 | /* |
||
206 | ** Maximum length (in bytes) of the pattern in a LIKE or GLOB |
||
207 | ** operator. |
||
208 | */ |
||
209 | //#if !SQLITE_MAX_LIKE_PATTERN_LENGTH |
||
210 | const int SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000; |
||
211 | //#endif |
||
212 | |||
213 | /* |
||
214 | ** Maximum depth of recursion for triggers. |
||
215 | ** |
||
216 | ** A value of 1 means that a trigger program will not be able to itself |
||
217 | ** fire any triggers. A value of 0 means that no trigger programs at all |
||
218 | ** may be executed. |
||
219 | */ |
||
220 | #if !SQLITE_MAX_TRIGGER_DEPTH |
||
221 | const int SQLITE_MAX_TRIGGER_DEPTH = 101; // # define SQLITE_MAX_TRIGGER_DEPTH 1000 |
||
222 | #else |
||
223 | const int SQLITE_MAX_TRIGGER_DEPTH=1; |
||
224 | #endif |
||
225 | } |
||
226 | } |