monotone

monotone Mtn Source Tree

Root/sqlite/limits.h

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

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status