Commit Graph

63 Commits

Author SHA1 Message Date
drh
8a93ce7458 Update the srctree-check.tcl script and child script so that they can be run
on a read-only source tree and so that if any inconsistencies are found, the
script returns a non-zero exit code and thus halts the build.

FossilOrigin-Name: 58eb5440d75fb13c1a089cb935de6fb94b4322e10e349db8f11f37b9a2fda2fc
2023-11-02 12:05:55 +00:00
drh
f2a777fa5d For the "PRAGMA database_list" statement, do not check to see if the schema
is up-to-date and do not try to reload the schema.

FossilOrigin-Name: 710de6a2137c872812effa43ea888aa77d339362ca0b6c8990d4426c8fb20689
2022-02-22 20:29:31 +00:00
drh
253888c13b The pragma_table_list virtual table should have only one "schema" column.
FossilOrigin-Name: 886feffaad6baac37dfaab489c2aecc4abf51a3a5bce1e8a94be7cc1d2a3c30c
2021-10-04 13:30:22 +00:00
drh
2e50f67073 Add the "PRAGMA table_list" command with its corresponding eponymous
table-valued function: "pragma_table_list".

FossilOrigin-Name: 2c0e7ae541e9ecb86aa58fa7e7057def8aac1b1af1af1aa80b8bf2d260f9a2f9
2021-09-21 17:26:23 +00:00
drh
b4d9b2b537 Demonstration code to show how NOT NULL and CHECK constraints can be
verified after an ALTER TABLE ADD COLUMN.

FossilOrigin-Name: 039f540373b03af9e0c87499e5e0423eb093d1d343829282a5ac1de2d600b881
2021-07-20 07:35:07 +00:00
drh
4b849b0b09 Fix the pragma_foreign_key_check virtual table so that it accepts arguments.
FossilOrigin-Name: 07f849dee3d245ecf80ba3c3ce8dfc630e71ddb1e9c0bcc1f08cee22001fcb07
2020-07-03 12:32:04 +00:00
drh
49a76a8fe5 Add "PRAGMA analysis_limit=N;" to limit the number of rows visited by
ANALYZE when N is positive.  Positive N also disables collecting stat4.

FossilOrigin-Name: a279b151c1623807774daf4975175c62ea252eefb71f9820ced6773769b392c5
2020-03-31 20:57:06 +00:00
drh
b48c0d59fa Simplify the code by removing the unsupported and undocumented
SQLITE_HAS_CODEC compile-time option

FossilOrigin-Name: 5a877221ce90e7523059353a68650c5fdd28ed032807afc2f10afbfbf864bdfe
2020-02-07 01:12:53 +00:00
drh
2b1c2aad9f Create the "trusted_schema" pragma. Add sqlite3_vtab_config() calls to set
the risk rank for many virtual tables.

FossilOrigin-Name: 4c21373c21c9b17b222ae65297a039a035e6ec6b505c00c33704e3c03f94f834
2020-01-07 19:45:40 +00:00
drh
79d5bc80c7 Enhance PRAGMA function_list so that it shows all instances of each FuncDef,
the number of arguments, the encoding, the type, and the flags.  Use this
capability to locate and fix incorrect function flags in the standard build.

FossilOrigin-Name: 9ca906d24a2e88eddb2fd067783512b66cfc49dce1596d816a1c38a09d128218
2020-01-04 01:43:02 +00:00
drh
803f06bf62 Merge recent enhancements from trunk.
FossilOrigin-Name: b8a631fd30d0732505679230684b3362c965438197a2b11518f01a77599c9202
2019-11-14 15:21:15 +00:00
drh
66c48907a2 Remove the legacy_file_format PRAGMA. In its place, provide the
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option to sqlite3_db_config().
Fix for ticket [6484e6ce678fffab]

FossilOrigin-Name: 4d424f3047b48fc441475137f30a719d2f079390c86fe2617710ddfb05c5e240
2019-10-29 16:18:45 +00:00
drh
007ba6457e Bring the hard-heap-limit branch up-to-date with trunk.
FossilOrigin-Name: 9b14eb77548d3f65f5a4c9b16cecdbce8a3fb663692aa8315fbd21aab3e89f0d
2019-08-20 17:14:21 +00:00
drh
cc3f3d1f05 Activate introspection pragmas by default. The new option
SQLITE_OMIT_INTROSPECTION_PRAGMAS must be provided to keep them out.

FossilOrigin-Name: 9c4bca64fb5f635296a8d7d7c1bf2808e02ca734a9983e5cee9132f5352a9a6d
2019-08-17 15:27:58 +00:00
drh
51e441da2b Combine the implementations of the key and hexkey pragmas into a single
case.  Have both pragmas return "ok" if they are implemented.

FossilOrigin-Name: b3692c406f7ba62587c9d3256f888748393519680e9e2db53f59557f1a300e05
2019-05-21 17:04:27 +00:00
drh
08652b5ea0 Provide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
omit the case_sensitive_like pragma.  This change, in combination with
documentation changes, is the current solution to ticket
[a340eef47b0cad5].

FossilOrigin-Name: eabe7f2d4ff0e0dd868dcab7ec1d4a9168a25f80d3a52f0eeea2f90bd33782f2
2019-05-08 17:27:18 +00:00
drh
10c0e7115b Add the sqlite3_hard_heap_limit64() interface and the corresponding
"PRAGMA hard_heap_limit=N" command.

FossilOrigin-Name: b0ccef61a7f92d20228becbf4f997bf0f4e46dad2deaf0896dc63b976ad1dd11
2019-04-25 18:15:38 +00:00
drh
01996dae49 Back out check-in [008112bcef561a8], reenabling deprecated PRAGMAs when the
SQLITE_OMIT_DEPRECATED compile-time option is used, because way too many
TH3 tests depend on those deprecated PRAGMAs.

FossilOrigin-Name: 9dbf512d1c4627a28d60f4e7238cb100d7a4e11f976139b07ad1c59e9b584c7d
2019-02-06 00:11:13 +00:00
drh
24545d2300 Keep the temp_store_directory and data_store_directory pragmas even when
compiling with SQLITE_OMIT_DEPRECATED.

FossilOrigin-Name: 93386a7c97f27df69f79052ef4d80143bb6832a806885249c315d226b2a256b2
2019-02-05 12:16:53 +00:00
drh
9b747068ba Improvements to "PRAGMA parser_trace=ON": Make it a flag pragma, and then
use the flag to show the complete SQL text at the beginning of the parse.

FossilOrigin-Name: 507c43537f00d089efb3c3020fb6e826e8f89f3efa2caaa12c5309d35dd0c22e
2019-01-31 01:39:01 +00:00
drh
3cc9af2140 Omit deprecated PRAGMAs when compiling with the -DSQLITE_OMIT_DEPRECATED option.
FossilOrigin-Name: 008112bcef561a8a3ebfb007cbef36cbc0071f547e6ebdba3d3bbb39e2c48c7a
2019-01-24 16:07:18 +00:00
drh
fd748c6460 Split the SQLITE_WriteSchema flag in two flags, WriteSchema and
SQLITE_NoSchemaError.  Set only WriteSchema on a VACUUM to avoid problems
when trying to vacuum a corrupt database.  With this change, the size
of the flags field on sqlite3 must grow from 32 to 64 bytes.

FossilOrigin-Name: 4f9878107a54356b7105fa1db7655ee239685d570436f6ad4d4221c9bd829b3d
2018-10-30 16:25:35 +00:00
drh
fa5c62ef2e Add the textkey and textrekey pragmas.
FossilOrigin-Name: f03164d45450cd7ff2162999aa9e51eec7fb5e7cab1fa83d876b544f8f841097
2018-10-11 18:41:50 +00:00
drh
bdc9744f60 Change the name of the pragma to PRAGMA table_xinfo. Improve the
mkpragmatab.tcl script to reuse column names where appropriate.

FossilOrigin-Name: 2fdd068987e59b979045d71ae64e700600ef07e54ae340f30c2064e5dcccb8ea
2018-10-01 21:26:30 +00:00
drh
d7dc0a36cc Add the extra "hidden" column to the end of the PRAGMA table_vinfo output.
FossilOrigin-Name: cf1b76135f511530dcc7b82f78c952bf97ebcddb40be06f713f9f2326915fabe
2018-10-01 18:28:42 +00:00
drh
5612ef1057 Bring the PRAGMA table_vinfo statement up to date with trunk.
FossilOrigin-Name: 6f606f99231f88ae5ff719d0ce21afc4b844490102c27ac20aa606baaf78d8d6
2018-10-01 17:15:17 +00:00
drh
15fc988ce0 Add the PRAGMA table_vinfo command (with an extra "v" before "info") that
works like PRAGMA table_info (without the "v") except that it also shows
hidden columns on virtual tables.

FossilOrigin-Name: 8bcd1a59560aa7ea73e6529e5c14ece8ac09bf7e99efdcfd388fead39846b6bf
2018-09-29 19:38:42 +00:00
dan
674b894269 Add a PRAGMA that restores the legacy ALTER TABLE RENAME TO behaviour.
FossilOrigin-Name: 5acad2e92c11c209bedc6ac8a709595e8070eed028ffc82af61499e5ceaa5e2b
2018-09-20 08:28:01 +00:00
drh
8ae11aac93 Add the "Pragma_list" pragma. Put all three pragmas created on this branch
inside of #ifdef SQLITE_INTROSPECTION_PRAGMAS.

FossilOrigin-Name: 2f3c3781ef3d66ecafef083d7144287ff23eea5a6d93b014dfeb2a8ac71f757e
2017-07-07 17:33:07 +00:00
drh
ab53bb635c Add new pragmas: "function_list" and "module_list"
FossilOrigin-Name: e5f01d7fde05fdb547f35816ff15c31a92c170b31877f4c640b7bc2be3f580b3
2017-07-07 15:43:22 +00:00
drh
169dd928c5 Add the SQLITE_DBCONFIG_ENABLE_QPSG option to activate the query planner
stability guarantee.  This involves refactoring the sqlite3.flags bitvector
to carve out a free bit to use.

FossilOrigin-Name: 7076e8283ebae1b45a5d85d9538b49b6da399d38c3c6935de100f948f814f6a9
2017-06-26 13:57:49 +00:00
drh
c45fdb2a7f Enable pragma virtual tables for the integrity_check, quick_check, and
foreign_key_check pragmas.

FossilOrigin-Name: 118f7bb33a6f78951bbffa957f48015d1bce5aaf9246a99262a90bc8ad52e5a3
2017-06-21 01:36:30 +00:00
drh
761f691d0e Force a schema load prior to "PRAGMA optimize".
FossilOrigin-Name: 86897c24c0b35ffea8df72d86a099addf67de210c6568aaba22ef92f1a60c3cf
2017-04-03 13:33:51 +00:00
drh
1cfaf8eafb Add an optional bitmask of allowed optimizations on the "PRAGMA optimize"
command.  The 0x01 bit is Debug Mode.

FossilOrigin-Name: a35388eef4096c1856b025dbd90143409d4a72d3
2017-03-02 14:17:21 +00:00
drh
2ead47cb49 Change the name of the analyze_as_needed pragma to "optimize". Enhance the
comment (which will become documentation, assuming these changes land on trunk)
to explain that the optimize pragma is likely to be enhanced in various ways
in future releases and that applications should not depend upon the current
behavior.

FossilOrigin-Name: 9fced545a6f80c55d6dc4a6106cb2d3569566b3e
2017-02-22 20:24:10 +00:00
drh
72052a73a3 Add the "PRAGMA analyze_as_needed" command.
FossilOrigin-Name: e93db2373127d31d33ec46ef918fa9386bb664a6
2017-02-17 16:26:34 +00:00
drh
a3928dd7be Set the TF_StatsUsed flag on tables when the query planner outcome is
affected by the sqlite_stat1 data.  Also, change the column names of the
"PRAGMA stats" command so that they are not keywords.

FossilOrigin-Name: fb2b8ae8310e4ea4b42354bbf36c3084a9d5c6d7
2017-02-17 15:26:36 +00:00
drh
33bec3f5e8 Enhance the Index and Table objects so that they remember if their stats come
from the sqlite_stat1 table.  Make the "PRAGMA stats" an SQLITE_DEBUG only
pragma.  Add the flags column to "PRAGMA stats".  These are all preliminary
steps toward a "PRAGMA analyze_ifneeded;" feature.

FossilOrigin-Name: 85026c8ee143bbd46565660fff8346ef81421546
2017-02-17 13:38:15 +00:00
dan
e1ff3f5e11 Ensure that "PRAGMA case_sensitive_like" and "PRAGMA shrink_memory" set the
number of output columns to 0 (as they are statements that return no data).

FossilOrigin-Name: 6696cd1878be4bd44a24841b04163e52d847711e
2017-01-06 13:49:40 +00:00
dan
9e1ab1a8a4 Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set"
PRAGMA statements that do not return a value in that case (e.g. page_size,
cache_size, auto_vacuum).

FossilOrigin-Name: 5c05d8ec5e895661dae2de30c73dfdeaff93511e
2017-01-05 19:32:48 +00:00
drh
2fcc1590c4 Code to automatically create eponymous virtual tables for read-only pragmas.
Compiles, but does not yet work.

FossilOrigin-Name: 988a61e8b03f302c69d11898d1ea95f002cba1a5
2016-12-15 20:59:03 +00:00
drh
c232aca184 Do more pragma processing from tables rather than in-line code.
FossilOrigin-Name: a88ca3524b97f296dffc68335466b3767a681747
2016-12-15 16:01:17 +00:00
drh
3592680734 Add the SQLITE_OMIT_PARSER_TRACE compile-time option.
FossilOrigin-Name: 2fda43e6e097a4a5510cce7784c31ceedc3d6e6d
2015-12-15 13:50:22 +00:00
drh
8d4482da96 Always parse the schema *before* running "PRAGMA cache_size", not after.
FossilOrigin-Name: 12e7d9ec023db4dd837f76006c87defc5a3e9388
2015-11-12 22:15:18 +00:00
drh
9b0cf34f81 First attempt at enhancing the "PRAGMA cache_spill" statement to accept a
cache threashold size.

FossilOrigin-Name: 549d42be0dac87dc04c3eeccfdc60615c3a6ad3f
2015-11-12 14:57:19 +00:00
drh
957026ac78 Defer the bulk pcache1 memory allocation until the first page allocation
request.  Limit the size of the pcache1 bulk allocation to the cache_size
setting.  Deallocate the bulk allocation on a sqlite3_db_release_memory()
request, if the bulk allocation is completely unused.

FossilOrigin-Name: b79a4affe44bd0c8e155cae19f3f62c715684cd6
2015-07-16 18:18:19 +00:00
drh
1421d980c5 Add the "PRAGMA cell_size_check=ON" command.
FossilOrigin-Name: 2ead43f074d01312c7642e1df9abccc95547f019
2015-05-27 03:46:18 +00:00
drh
4bb8cb0927 Merge all recent trunk changes, including the movement of the pragma
table into the separate pragma.h header file.

FossilOrigin-Name: 3af19f84446ba5fc1ed754d0d73f6a6d7fb2f365
2015-02-04 23:13:48 +00:00
drh
67e65e55ab Break out the (script-generated) pragma parsing tables into a separate file,
pragma.h, to make editing easier.

FossilOrigin-Name: 32c0325bcb083fe3f0f0cfe999d00f754e15299e
2015-02-02 21:34:54 +00:00
drh
c228be5b1f Add the "index_xinfo" pragma. Add new columns to the "index_info" and
"index_list" pragmas.

FossilOrigin-Name: 30f51d7b3b292191e8351223242e708bb7f3dfa6
2015-01-31 02:00:01 +00:00