diff --git a/Makefile.in b/Makefile.in index ecc97ada3f..ea33879124 100644 --- a/Makefile.in +++ b/Makefile.in @@ -245,7 +245,7 @@ HDR = \ $(TOP)/src/btree.h \ $(TOP)/src/btreeInt.h \ $(TOP)/src/hash.h \ - $(TOP)/src/limits.h \ + $(TOP)/src/sqliteLimit.h \ opcodes.h \ $(TOP)/src/os.h \ $(TOP)/src/os_common.h \ diff --git a/main.mk b/main.mk index 14fe045be3..970605582f 100644 --- a/main.mk +++ b/main.mk @@ -200,7 +200,7 @@ HDR = \ $(TOP)/src/btree.h \ $(TOP)/src/btreeInt.h \ $(TOP)/src/hash.h \ - $(TOP)/src/limits.h \ + $(TOP)/src/sqliteLimit.h \ opcodes.h \ $(TOP)/src/os.h \ $(TOP)/src/os_common.h \ diff --git a/manifest b/manifest index d03803fa39..4dee9f06e1 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ -C Do\snot\ssegfault\seven\sif\ssqlite\sis\smisused\sby\srequesting\squery\sresults\nafter\sthe\squery\shas\sbeen\sreset.\s\sticket\s#2426.\s(CVS\s4090) -D 2007-06-19T10:58:24 -F Makefile.in b9971ab07868cf2b3209fe3bf8c52e7e25af4193 +C Change\sthe\sname\sof\sthe\s"limits.h"\ssource\sfile\sto\s"sqliteLimit.h".\r\nTicket\s#2428.\s(CVS\s4091) +D 2007-06-19T15:23:48 +F Makefile.in 5babd49c427a0e82e849c89a4d3c3c1e607ec014 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F VERSION bd995b15c92d73ccf2f3e65d51702f88efea8001 @@ -48,7 +48,7 @@ F ext/icu/README.txt a470afe5adf6534cc0bdafca31e6cf4d88c321fa F ext/icu/icu.c daab19e2c5221685688ecff2bb75bf9e0eea361d F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 F ltmain.sh 56abb507100ed2d4261f6dd1653dec3cf4066387 -F main.mk 02007ce4a5de0d4d6561207dcf839db9a3166935 +F main.mk f9b489de8f79174d29082cb87bfdfcd89e1135ec F mkdll.sh 37fa8a7412e51b5ab2bc6d4276135f022a0feffb F mkopcodec.awk bd46ad001c98dfbab07b1713cb8e692fa0e5415d F mkopcodeh.awk cde995d269aa06c94adbf6455bea0acedb913fa5 @@ -106,7 +106,8 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c d07ae326b3815d80f71c69b3c7584382e47f6447 F src/sqlite.h.in 6bd26a1429d96d72bb0e2c72fdd323defa2f558a F src/sqlite3ext.h 7d0d363ea7327e817ef0dfe1b7eee1f171b72890 -F src/sqliteInt.h 208c40b6e11925a321ec159d889e0ec06b618359 +F src/sqliteInt.h 07b0f7a4b7e849c9b96d921e9c5b32fc8802072c +F src/sqliteLimit.h f14609c27636ebc217c9603ade26dbdd7d0f6afa F src/table.c a8de75bcedf84d4060d804264b067ab3b1a3561d F src/tclsqlite.c 9f96385c5047b24afa7601ea4055aae97c3e25e3 F src/test1.c a83c097ee1353e8982745ee1b78612fea7425602 @@ -437,8 +438,8 @@ F tool/memleak2.awk 9cc20c8e8f3c675efac71ea0721ee6874a1566e8 F tool/memleak3.tcl 7707006ee908cffff210c98158788d85bb3fcdbf F tool/mkkeywordhash.c fe15d1cbc61c2b0375634b6d8c1ef24520799ea0 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x -F tool/mksqlite3c.tcl a1c49f75558b32cadae8b4f558af44a2292fb6f3 -F tool/mksqlite3internalh.tcl 09152fdc0c5fd779a3ac5759a043f08d2f609248 +F tool/mksqlite3c.tcl 92ed1980d3e35740ed23f2f60d25433b891b5c8b +F tool/mksqlite3internalh.tcl 47737a925fb02fce43e2c0a14b3cc17574a4d44a F tool/omittest.tcl e6b3d6a1285f9813bc1dea53bb522b4b72774710 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816 @@ -506,7 +507,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 0b20a69609c64af922bedab381f7d075e9da4fc5 -R 87fdbce58a1cae51fbd4daaedd8f598b +P 783f19be387561fbca3ac7e223bdb7dedb5450c8 +R f61ebf06a1a8beeee76386cd58589428 U drh -Z eca7e9243576251c9daf0bfe44dbf734 +Z c4d6065cec2901822a6c14d9f99cfb91 diff --git a/manifest.uuid b/manifest.uuid index e72ac19cc9..b4d1071a9d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -783f19be387561fbca3ac7e223bdb7dedb5450c8 \ No newline at end of file +64bcc41f12e902fd025c9ba36c09dd6e4cf25923 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 5cf95fdb90..eca83996e5 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,11 +11,11 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.572 2007/06/10 22:57:33 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.573 2007/06/19 15:23:48 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ -#include "limits.h" +#include "sqliteLimit.h" #if defined(SQLITE_TCL) || defined(TCLSH) diff --git a/src/sqliteLimit.h b/src/sqliteLimit.h new file mode 100644 index 0000000000..6b7ad98005 --- /dev/null +++ b/src/sqliteLimit.h @@ -0,0 +1,158 @@ +/* +** 2007 May 7 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file defines various limits of what SQLite can process. +** +** @(#) $Id: sqliteLimit.h,v 1.1 2007/06/19 15:23:48 drh Exp $ +*/ + +/* +** The maximum length of a TEXT or BLOB in bytes. This also +** limits the size of a row in a table or index. +** +** The hard limit is the ability of a 32-bit signed integer +** to count the size: 2^31-1 or 2147483647. +*/ +#ifndef SQLITE_MAX_LENGTH +# define SQLITE_MAX_LENGTH 1000000000 +#endif + +/* +** This is the maximum number of +** +** * Columns in a table +** * Columns in an index +** * Columns in a view +** * Terms in the SET clause of an UPDATE statement +** * Terms in the result set of a SELECT statement +** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. +** * Terms in the VALUES clause of an INSERT statement +** +** The hard upper limit here is 32676. Most database people will +** tell you that in a well-normalized database, you usually should +** not have more than a dozen or so columns in any table. And if +** that is the case, there is no point in having more than a few +** dozen values in any of the other situations described above. +*/ +#ifndef SQLITE_MAX_COLUMN +# define SQLITE_MAX_COLUMN 2000 +#endif + +/* +** The maximum length of a single SQL statement in bytes. +** The hard limit here is the same as SQLITE_MAX_LENGTH. +*/ +#ifndef SQLITE_MAX_SQL_LENGTH +# define SQLITE_MAX_SQL_LENGTH 1000000 +#endif + +/* +** The maximum depth of an expression tree. This is limited to +** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might +** want to place more severe limits on the complexity of an +** expression. A value of 0 (the default) means do not enforce +** any limitation on expression tree depth. +*/ +#ifndef SQLITE_MAX_EXPR_DEPTH +# define SQLITE_MAX_EXPR_DEPTH 1000 +#endif + +/* +** The maximum number of terms in a compound SELECT statement. +** The code generator for compound SELECT statements does one +** level of recursion for each term. A stack overflow can result +** if the number of terms is too large. In practice, most SQL +** never has more than 3 or 4 terms. Use a value of 0 to disable +** any limit on the number of terms in a compount SELECT. +*/ +#ifndef SQLITE_MAX_COMPOUND_SELECT +# define SQLITE_MAX_COMPOUND_SELECT 500 +#endif + +/* +** The maximum number of opcodes in a VDBE program. +** Not currently enforced. +*/ +#ifndef SQLITE_MAX_VDBE_OP +# define SQLITE_MAX_VDBE_OP 25000 +#endif + +/* +** The maximum number of arguments to an SQL function. +*/ +#ifndef SQLITE_MAX_FUNCTION_ARG +# define SQLITE_MAX_FUNCTION_ARG 100 +#endif + +/* +** The maximum number of in-memory pages to use for the main database +** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE +*/ +#ifndef SQLITE_DEFAULT_CACHE_SIZE +# define SQLITE_DEFAULT_CACHE_SIZE 2000 +#endif +#ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE +# define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500 +#endif + +/* +** The maximum number of attached databases. This must be at least 2 +** in order to support the main database file (0) and the file used to +** hold temporary tables (1). And it must be less than 32 because +** we use a bitmask of databases with a u32 in places (for example +** the Parse.cookieMask field). +*/ +#ifndef SQLITE_MAX_ATTACHED +# define SQLITE_MAX_ATTACHED 10 +#endif + + +/* +** The maximum value of a ?nnn wildcard that the parser will accept. +*/ +#ifndef SQLITE_MAX_VARIABLE_NUMBER +# define SQLITE_MAX_VARIABLE_NUMBER 999 +#endif + +/* +** The default size of a database page. +*/ +#ifndef SQLITE_DEFAULT_PAGE_SIZE +# define SQLITE_DEFAULT_PAGE_SIZE 1024 +#endif + +/* Maximum page size. The upper bound on this value is 32768. This a limit +** imposed by the necessity of storing the value in a 2-byte unsigned integer +** and the fact that the page size must be a power of 2. +*/ +#ifndef SQLITE_MAX_PAGE_SIZE +# define SQLITE_MAX_PAGE_SIZE 32768 +#endif + +/* +** Maximum number of pages in one database file. +** +** This is really just the default value for the max_page_count pragma. +** This value can be lowered (or raised) at run-time using that the +** max_page_count macro. +*/ +#ifndef SQLITE_MAX_PAGE_COUNT +# define SQLITE_MAX_PAGE_COUNT 1073741823 +#endif + +/* +** Maximum length (in bytes) of the pattern in a LIKE or GLOB +** operator. +*/ +#ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH +# define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000 +#endif diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 389f7a21dc..df93daf509 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -80,7 +80,6 @@ foreach hdr { btreeInt.h hash.h keywordhash.h - limits.h opcodes.h os_common.h os.h @@ -90,6 +89,7 @@ foreach hdr { sqlite3ext.h sqlite3.h sqliteInt.h + sqliteLimit.h vdbe.h vdbeInt.h } { diff --git a/tool/mksqlite3internalh.tcl b/tool/mksqlite3internalh.tcl index 26a5f032bc..cacd7cbe18 100644 --- a/tool/mksqlite3internalh.tcl +++ b/tool/mksqlite3internalh.tcl @@ -57,7 +57,6 @@ foreach hdr { btreeInt.h hash.h keywordhash.h - limits.h opcodes.h os_common.h os.h @@ -67,6 +66,7 @@ foreach hdr { sqlite3ext.h sqlite3.h sqliteInt.h + sqliteLimit.h vdbe.h vdbeInt.h } {