Improve support for the SQLITE_OMIT_FLAG_PRAGMAS compile-time option.

FossilOrigin-Name: f1d8c3b07e61c5a8b39675d0d62876ca15e207f3
This commit is contained in:
mistachkin 2013-10-21 23:17:23 +00:00
parent 05684271c6
commit dd19783225
4 changed files with 82 additions and 13 deletions

View File

@ -1,5 +1,5 @@
C Improved\sheader\scomment\swith\sbetter\sinstructions\son\sthe\svfslog.c\nextension.
D 2013-10-19T16:51:39.506
C Improve\ssupport\sfor\sthe\sSQLITE_OMIT_FLAG_PRAGMAS\scompile-time\soption.
D 2013-10-21T23:17:23.344
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -212,7 +212,7 @@ F src/parse.y a97566d6da75075589a7c716d1bda14b586cf8da
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222
F src/pcache1.c a467393909a4ed7ca9de066d85ba5c5b04a5be63
F src/pragma.c 64d3d1f8b4ed144ba85c061d00d96d6be8aa2fea
F src/pragma.c 6fb3125fff078cd81db0039ac778948df4e8cb6f
F src/prepare.c fa6988589f39af8504a61731614cd4f6ae71554f
F src/printf.c da9119eb31a187a4b99f60aa4a225141c0ebb74b
F src/random.c 0b2dbc37fdfbfa6bd455b091dfcef5bdb32dba68
@ -1093,7 +1093,7 @@ F tool/logest.c 7ad625cac3d54012b27d468b7af6612f78b9ba75
F tool/mkautoconfamal.sh f8d8dbf7d62f409ebed5134998bf5b51d7266383
F tool/mkkeywordhash.c bb52064aa614e1426445e4b2b9b00eeecd23cc79
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 3fc52e00a234750675e8a569d2919ff48558e9eb
F tool/mkpragmatab.tcl 17d40faae6c4b865633bfc5763821402a1cbefc3
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02
F tool/mksqlite3c.tcl d8dc444d403019167260e5578f5c362741f03696
@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 56dca4a65c3b14123272fa0cc5c15530c06fda28
R 1cee309be53ed4b90f763a6791fd81dc
U drh
Z 23f623447e2329bbecfcb9fee8496fa4
P 4bd592c8f0e011e203443a6e88008a61d6926df5
R 53b76eeb5375ab8ab4a6606d590d0d10
U mistachkin
Z 54790c9a063cf1ed56ef1eaa1dcf530f

View File

@ -1 +1 @@
4bd592c8f0e011e203443a6e88008a61d6926df5
f1d8c3b07e61c5a8b39675d0d62876ca15e207f3

View File

@ -94,11 +94,13 @@ static const struct sPragmaNames {
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
{ /* zName: */ "automatic_index",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_AutoIndex },
#endif
#endif
{ /* zName: */ "busy_timeout",
/* ePragTyp: */ PragTyp_BUSY_TIMEOUT,
@ -110,18 +112,22 @@ static const struct sPragmaNames {
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "cache_spill",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_CacheSpill },
#endif
{ /* zName: */ "case_sensitive_like",
/* ePragTyp: */ PragTyp_CASE_SENSITIVE_LIKE,
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "checkpoint_fullfsync",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_CkptFullFSync },
#endif
#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
{ /* zName: */ "collation_list",
/* ePragTyp: */ PragTyp_COLLATION_LIST,
@ -134,10 +140,12 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "count_changes",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_CountRows },
#endif
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
{ /* zName: */ "data_store_directory",
/* ePragTyp: */ PragTyp_DATA_STORE_DIRECTORY,
@ -156,16 +164,20 @@ static const struct sPragmaNames {
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
{ /* zName: */ "defer_foreign_keys",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_DeferFKs },
#endif
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "empty_result_callbacks",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_NullCallback },
#endif
#if !defined(SQLITE_OMIT_UTF16)
{ /* zName: */ "encoding",
/* ePragTyp: */ PragTyp_ENCODING,
@ -184,18 +196,21 @@ static const struct sPragmaNames {
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
{ /* zName: */ "foreign_keys",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_ForeignKeys },
#endif
#endif
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{ /* zName: */ "freelist_count",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "full_column_names",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
@ -204,6 +219,7 @@ static const struct sPragmaNames {
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_FullFSync },
#endif
#if defined(SQLITE_HAS_CODEC)
{ /* zName: */ "hexkey",
/* ePragTyp: */ PragTyp_HEXKEY,
@ -214,12 +230,14 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if !defined(SQLITE_OMIT_CHECK)
{ /* zName: */ "ignore_check_constraints",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_IgnoreChecks },
#endif
#endif
#if !defined(SQLITE_OMIT_AUTOVACUUM)
{ /* zName: */ "incremental_vacuum",
/* ePragTyp: */ PragTyp_INCREMENTAL_VACUUM,
@ -258,10 +276,12 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "legacy_file_format",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_LegacyFileFmt },
#endif
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
{ /* zName: */ "lock_proxy_file",
/* ePragTyp: */ PragTyp_LOCK_PROXY_FILE,
@ -302,16 +322,19 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "query_only",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_QueryOnly },
#endif
#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
{ /* zName: */ "quick_check",
/* ePragTyp: */ PragTyp_INTEGRITY_CHECK,
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "read_uncommitted",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
@ -320,16 +343,19 @@ static const struct sPragmaNames {
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_RecTriggers },
#endif
#if defined(SQLITE_HAS_CODEC)
{ /* zName: */ "rekey",
/* ePragTyp: */ PragTyp_REKEY,
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "reverse_unordered_selects",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_ReverseOrder },
#endif
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{ /* zName: */ "schema_version",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
@ -342,10 +368,12 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "short_column_names",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_ShortColNames },
#endif
{ /* zName: */ "shrink_memory",
/* ePragTyp: */ PragTyp_SHRINK_MEMORY,
/* ePragFlag: */ 0,
@ -354,12 +382,14 @@ static const struct sPragmaNames {
/* ePragTyp: */ PragTyp_SOFT_HEAP_LIMIT,
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if defined(SQLITE_DEBUG)
{ /* zName: */ "sql_trace",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_SqlTrace },
#endif
#endif
#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
{ /* zName: */ "stats",
/* ePragTyp: */ PragTyp_STATS,
@ -394,6 +424,7 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
#if defined(SQLITE_DEBUG)
{ /* zName: */ "vdbe_addoptrace",
/* ePragTyp: */ PragTyp_FLAG,
@ -412,6 +443,7 @@ static const struct sPragmaNames {
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_VdbeTrace },
#endif
#endif
#if !defined(SQLITE_OMIT_WAL)
{ /* zName: */ "wal_autocheckpoint",
/* ePragTyp: */ PragTyp_WAL_AUTOCHECKPOINT,
@ -422,10 +454,12 @@ static const struct sPragmaNames {
/* ePragFlag: */ PragFlag_NeedSchema,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{ /* zName: */ "writable_schema",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlag: */ 0,
/* iArg: */ SQLITE_WriteSchema|SQLITE_RecoveryMode },
#endif
};
/* Number of pragmas: 56 on by default, 68 total. */
/* End of the automatically generated pragma table.

View File

@ -14,98 +14,120 @@ set pragma_def {
NAME: full_column_names
TYPE: FLAG
ARG: SQLITE_FullColNames
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: short_column_names
TYPE: FLAG
ARG: SQLITE_ShortColNames
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: count_changes
TYPE: FLAG
ARG: SQLITE_CountRows
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: empty_result_callbacks
TYPE: FLAG
ARG: SQLITE_NullCallback
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: legacy_file_format
TYPE: FLAG
ARG: SQLITE_LegacyFileFmt
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: fullfsync
TYPE: FLAG
ARG: SQLITE_FullFSync
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: checkpoint_fullfsync
TYPE: FLAG
ARG: SQLITE_CkptFullFSync
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: cache_spill
TYPE: FLAG
ARG: SQLITE_CacheSpill
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: reverse_unordered_selects
TYPE: FLAG
ARG: SQLITE_ReverseOrder
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: query_only
TYPE: FLAG
ARG: SQLITE_QueryOnly
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: automatic_index
TYPE: FLAG
ARG: SQLITE_AutoIndex
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
NAME: sql_trace
TYPE: FLAG
ARG: SQLITE_SqlTrace
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: defined(SQLITE_DEBUG)
NAME: vdbe_listing
TYPE: FLAG
ARG: SQLITE_VdbeListing
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: defined(SQLITE_DEBUG)
NAME: vdbe_trace
TYPE: FLAG
ARG: SQLITE_VdbeTrace
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: defined(SQLITE_DEBUG)
NAME: vdbe_addoptrace
TYPE: FLAG
ARG: SQLITE_VdbeAddopTrace
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: defined(SQLITE_DEBUG)
NAME: vdbe_debug
TYPE: FLAG
ARG: SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: defined(SQLITE_DEBUG)
NAME: ignore_check_constraints
TYPE: FLAG
ARG: SQLITE_IgnoreChecks
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: !defined(SQLITE_OMIT_CHECK)
NAME: writable_schema
TYPE: FLAG
ARG: SQLITE_WriteSchema|SQLITE_RecoveryMode
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: read_uncommitted
TYPE: FLAG
ARG: SQLITE_ReadUncommitted
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: recursive_triggers
TYPE: FLAG
ARG: SQLITE_RecTriggers
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
NAME: foreign_keys
TYPE: FLAG
ARG: SQLITE_ForeignKeys
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
NAME: defer_foreign_keys
TYPE: FLAG
ARG: SQLITE_DeferFKs
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
IF: !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
NAME: default_cache_size
@ -267,6 +289,7 @@ set pragma_def {
NAME: soft_heap_limit
}
fconfigure stdout -translation lf
set name {}
set type {}
set if {}
@ -296,7 +319,7 @@ foreach line [split $pragma_def \n] {
} elseif {$id=="ARG"} {
set arg $val
} elseif {$id=="IF"} {
set if $val
lappend if $val
} elseif {$id=="FLAG"} {
foreach term [split $val] {
lappend flags $term
@ -362,9 +385,17 @@ set spacer [format { %26s } {}]
foreach name $allnames {
foreach {type arg if flag} $allbyname($name) break
if {$if!=$current_if} {
if {$current_if!=""} {puts "#endif"}
if {$current_if!=""} {
foreach this_if $current_if {
puts "#endif"
}
}
set current_if $if
if {$current_if!=""} {puts "#if $current_if"}
if {$current_if!=""} {
foreach this_if $current_if {
puts "#if $this_if"
}
}
}
set typex [format PragTyp_%-23s $type,]
if {$flag==""} {
@ -377,7 +408,11 @@ foreach name $allnames {
puts " /* ePragFlag: */ $flagx,"
puts " /* iArg: */ $arg \175,"
}
if {$current_if!=""} {puts "#endif"}
if {$current_if!=""} {
foreach this_if $current_if {
puts "#endif"
}
}
puts "\175;"
# count the number of pragmas, for information purposes