Commit Graph

1168 Commits

Author SHA1 Message Date
drh
c0622a4d03 Alternative implementation of ".selecttrace" and ".wheretrace" that uses
a test-control rather than global variables.

FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2
2020-12-04 01:17:57 +00:00
dan
2b06b0769e Ensure that the busy-handler count is reset at the end of each sqlite3_file_control() and sqlite3_prepare() (and _v2() and _v3()).
FossilOrigin-Name: 5dd05940617fb05ee2faf212b15afc3a8e9695318eccb76761b37359fea681d1
2020-09-04 17:30:59 +00:00
drh
d321b6f4ad Fix a harmless compiler warning.
FossilOrigin-Name: 3ca0b7d54d73d07cd6b32e650a809174bb1cd66ce5ecdb36f65b70899ea05824
2020-09-01 00:26:21 +00:00
drh
37ccfcfeb9 New test-control that returns the number of calls to
sqlite3BtreeMovetoUnpacked() on the main database and then resets the
counter.  This only works for SQLITE_DEBUG builds.

FossilOrigin-Name: dca5b91926431768babac28a6faf7674a5014db95caba727995b470e92b3182a
2020-08-31 18:49:04 +00:00
drh
99744fa4ab Add support for the sqlite3_txn_state() interface.
FossilOrigin-Name: ad195e3dd89d0f33b50070c18fb8f43c4eb24162515dfdd7c04d9e7d96b902a2
2020-08-25 19:09:07 +00:00
drh
8c1fbe81d0 Minor comment fixes. No changes to code.
FossilOrigin-Name: 533aeb90085d989078073067172135db98e37e00be84f99757255858126196e4
2020-08-11 17:20:02 +00:00
drh
08b9208660 Fix harmless compiler warnings that surface in newer versions of GCC.
FossilOrigin-Name: 9d670a318381f219b467653f5f9539097808b887ae37291ce13be462dedfb18d
2020-08-10 14:18:00 +00:00
drh
25a78fdfa2 Merge recent changes from trunk.
FossilOrigin-Name: 22e8e6901a119698de831ede6d8b03c4fd6576eaa8686a97a0b8aeea7593688a
2020-07-24 13:49:38 +00:00
drh
8adc8f1ecb Remove a surplus space from a comment
FossilOrigin-Name: 73fecc688ab5c459245c9bb89432139a083ef378404b4dae3397a7f4e253f72a
2020-07-24 11:01:29 +00:00
drh
ca439a4967 Disable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS
setting is off, to facilitate reaching obscure error states during testing.

FossilOrigin-Name: d7dd4fc464c791915f646b1ad228697d1fa16f530fc7d0e9aa702c8df3068c65
2020-07-22 21:05:23 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
drh
1e32bed3c1 Further refactoring of the schema table name.
FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
2020-06-19 13:33:53 +00:00
drh
ccb2113a62 Refactoring various names. No changes in the resulting machine code.
FossilOrigin-Name: 7bb08b1bfcf184e4b59c8c9028926a0052612ff6a6731914ccdb8dee07ea4a98
2020-06-19 11:34:57 +00:00
drh
c48428899d Extra memory barrier during initialization.
FossilOrigin-Name: 043a7e142dfc2b0da5fbc0b025d005ccad4886f0b0ff65426ba9155ca40394ca
2020-05-16 16:23:48 +00:00
drh
bbf6d4328e Adjust some requirement marks. No changes to code.
FossilOrigin-Name: 7285ae2ce8fb1439e1acea2ec321abbc76aab0a2e84b58683fddb0a7bf74fb1b
2020-05-15 15:03:51 +00:00
dan
4cbe5d3588 Merge trunk changes into this branch.
FossilOrigin-Name: ac4ee69664278a828e0a64c5be3b96fdb6eb6acc95646a9425c667aea328791c
2020-05-07 14:05:08 +00:00
drh
e937df81f0 Fix the handling of reserve-bytes so that the maximum value of 255 can be used.
FossilOrigin-Name: 99749d4fd4930ccf15227f67c732266af9e09dd3cabdc0834fb450ef98196441
2020-05-07 01:56:57 +00:00
drh
783e159e48 Fix harmless compiler warnings.
FossilOrigin-Name: 92dc59132f8547635d73c61c21ea29b380c401ddc84a6d01412808e00386b9e8
2020-05-06 20:55:38 +00:00
dan
861fb1e9dc Block on the WRITER lock when attempting to run recovery.
FossilOrigin-Name: 105d6c9bbcadc64faa2b24e315cb13227b17cfc6bf1b3512713f80ce56976a3d
2020-05-06 19:14:41 +00:00
drh
e0a8b712c1 Provide the SQLITE_DEFAULT_LEGACY_ALTER_TABLE compile-time option.
FossilOrigin-Name: 63e659d9a793227604aa95685a8d83cd08305f1d01e135407a3ffc6d54482ab8
2020-05-06 18:43:57 +00:00
dan
293e9f5d6c Merge latest trunk changes into this branch.
FossilOrigin-Name: a3727dba10b476f414f0a049b35f2a5c169a408eccefa6833821560684e07f8b
2020-05-06 15:07:25 +00:00
dan
8714de97c0 Changes to avoid deadlock in SQLITE_ENABLE_SETLK_TIMEOUT builds.
FossilOrigin-Name: 553423c23142cf0ec219192315d57ce8a0e10c3d8678d28bc110a1a9a7c17cee
2020-05-04 19:42:35 +00:00
drh
20e34f9110 Simplify the initialization of built-in extensions.
FossilOrigin-Name: 729f2397358d0382e255ba0058bf70bc9ed410b7621a67466da13de437d3ba5c
2020-05-04 17:15:21 +00:00
drh
51f1c6f3ec Merge recent enhancements from trunk.
FossilOrigin-Name: 96dfc71ea599702ef38b60952d03e95dce5a8c534cd943e076e9c76b00e61e65
2020-05-01 18:58:21 +00:00
drh
45248de39a The SQLITE_TESTCTRL_RESERVE operator is removed. In its place is the
more generate SQLITE_FCNTL_RESERVE_BYTES which is an API and which can
operator on more than just the main schema.

FossilOrigin-Name: abc1aad74f7b6a1e72fb09936239f2224aa942d16296c6a3de0b8daef4bc8471
2020-04-20 15:18:43 +00:00
drh
e065a18a4b Merge enhancements from trunk.
FossilOrigin-Name: d1731385c077f298b0cf654d6183ed40f7e5c07e4e2ab7f69109cf951ce99d9e
2020-04-02 12:24:08 +00:00
dan
892edb69c4 Use __atomic_load_n() and __atomic_store_n() for a few more things where they are available.
FossilOrigin-Name: a49f8ec552bede7da731e0571ccf49de1a30e7be3a5673150436c8b411ba6ffc
2020-03-30 13:35:05 +00:00
dan
97ccc1bd11 Modifications to the way blocking locks are used in SQLITE_ENABLE_SETLK_TIMEOUT builds so that multiple processes or threads may not deadlock when operating on a single database.
FossilOrigin-Name: c516027d5fd876b7d0bf566435667d554db29ded30ad6fc1165caa4a93d015a0
2020-03-27 17:23:17 +00:00
drh
691b5c54b8 Infrastructure for the bytecode() table-valued function. The function itself
is not yet implemented.

FossilOrigin-Name: 2795f0d633577e0de66b389d9e8e44c55e85975bdc62f1a0b8f93959d19b22bf
2020-03-23 15:49:22 +00:00
drh
42a630b1da Change the sqlite3.pDfltColl (the default collating sequence for the
database connection) so that it is the collating sequence appropriate for
the database encoding, not the UTF8 collating sequence.  This helps to
ensure that the database encoding collation is always used, even for
expressions that do not have an defined collating sequence.
Ticket [1b8d7264567eb6fc].

FossilOrigin-Name: 4a5851893c3d71cc823b6ab5df5e58a852cd322fff26290f1ea05b63d67f564a
2020-03-05 16:13:24 +00:00
drh
df97d43930 Ensure that the filename passed into the xFullPathname method of the VFS is
acceptable as an argument to sqlite3_uri_parameter().  The interface spec does
not guarantee this, but it has been so historically and some applications
have come to depends on it.

FossilOrigin-Name: bfb09371d452d5d4dacab2ec476880bc729952f44ac0e5de90ea7ba203243c8c
2020-02-27 11:32:14 +00:00
drh
4defdddc31 Add the new sqlite3_create_filename() and sqlite3_free_filename() interfaces
for use by Shims.  Use these interfaces inside the multiplexor.

FossilOrigin-Name: 9469f36ac89e4b75d0ab25fefbeff25201992c53141da915dcaa017083cab6db
2020-02-18 19:49:48 +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
5bdad79f01 Remove dead code from the sqlite3_filename_database() function.
FossilOrigin-Name: 1b6185550f2bcfa11513898984f1fc2029e0356e9acdc786c5c4a8006b1da2ba
2020-02-06 13:09:56 +00:00
dan
3cdc820544 Enable more detailed log messages in SQLITE_ENABLE_CORRUPT_PGNO builds if database corruption is encountered.
FossilOrigin-Name: 57c36a293e16bb4d9652874124ee1447bef278e08664bc8dd0070a0ee2ef1173
2020-02-04 20:01:44 +00:00
drh
745befd13f Merge the sqlite3CodecQueryParameters() fix into trunk.
FossilOrigin-Name: a812f533693a3605f297199ae0320d663e872208675e86860c5c1803943943aa
2020-02-01 14:20:35 +00:00
drh
1eac966076 Fix a problem in sqlite3CodecQueryParameters() that was introduced by the
query parameter encoding changes for the 3.31.1 release.

FossilOrigin-Name: cc65ca541265bd7061ed8f5ec9a54f3c384c41019c5ea1c68dcaabeff3495839
2020-02-01 13:30:39 +00:00
drh
ffd3fd0c30 Add new memory barriers during initialization.
FossilOrigin-Name: a9b2adc5d61790abd86839d12e7ecb98a85d7e4cde5f94558530e32449d9e483
2020-01-29 13:10:50 +00:00
drh
532b0d23fd Revise the layout of filenames in the Pager object so that it is unchanged
from prior versions.  It turns out that some important 3rd-party software
does questionable pointer manipulations on those filenames that depend on
that legacy layout.  Technical this is a misuse of SQLite by the 3rd-party
software, but we want to avoid unnecessary breakage.

FossilOrigin-Name: 34ab760689fd493eda482e856047708d74e769a01cc90b69da456d79ffe39aea
2020-01-27 14:40:44 +00:00
drh
ef9f719d0b Fix #ifdefs so it compiles cleanly with all SQLITE_OMIT compile-time options.
Update compile-time option testing.

FossilOrigin-Name: 7584e4b649d57767aac3906da6b06549d5b772aaa69f469c623ae5da834d54d5
2020-01-17 19:14:08 +00:00
drh
cdfadc7948 Minor changes for consistency between sqlite3_filename_wal() and
sqlite3_filename_journal().

FossilOrigin-Name: 9a70ff43a7b6848a71d5049f5a4ae24e3eb8a83d5c6651f5a9937abf03b3eccf
2020-01-11 20:27:02 +00:00
drh
8080403e44 Redesign for better legacy compatibility. Add the sqlite3_uri_key() interface.
FossilOrigin-Name: bcb43d11c4d0be36888c9e968ccdf85e7d7fccd72a29866f85c014e0562d4b93
2020-01-11 16:08:31 +00:00
drh
8875b9e7b5 Rearchitect the way in which filenames are stored in the Pager object so that
the sqlite3_uri_parameter() interface will work from journal and WAL filenames
too.  This check-in implements the central idea, and compile and runs somewhat,
but crashes on an extended test.

FossilOrigin-Name: 2ae77bd2335708343bce4541b4d2cf16edfe3fd5bc2dfb93757238c926aa960b
2020-01-10 18:05:55 +00:00
drh
b77da374ab Invert the UNTRUSTED_SCHEMA setting to be TRUSTED_SCHEMA.
FossilOrigin-Name: f5fcf1fbc6473f8e91315b14d67745f2748010641b7463d1f4ca51e6fdf97462
2020-01-07 16:09:11 +00:00
drh
2928a15b3c Refactor names of flags for improved legibility.
FossilOrigin-Name: 411e8ec2219bb4181aaf2209fb1e7baf5e8df8b8c8adb82a69b48cf7e8e7e7d4
2020-01-06 15:25:41 +00:00
drh
67c826536f Refactor the names of the new controls for restricting what actions the schema
can take behind the application's back.

FossilOrigin-Name: 65d7d39a858c51ffd781f5a6335e029895e597aeb1e1ccdadea8ce79c8ad412f
2020-01-04 20:58:41 +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
4be621e1ba Invert the SQLITE_FUNC_SAFE bit to be SQLITE_FUNC_UNSAFE. The external
bit is still SQLITE_INNOCUOUS.  It gets inverted as the appdef function
is registered.

FossilOrigin-Name: 1c266cb3be46d26e640752a99979acb1a1809361ba70ca3fca981c42383c360e
2020-01-03 21:57:53 +00:00
drh
c4ad849921 When UNSAFE_IN_VIEW is disabled, only allow functions in views that are
tagged with SQLITE_INNOCUOUS.

FossilOrigin-Name: 9ee79b254e4c51a2a41f7ed49ad389d8d7105e649483adb79772052fa0ade3c0
2020-01-03 20:57:38 +00:00
drh
618ee33614 Merge enhancements from trunk.
FossilOrigin-Name: 091403a6705f5f1352c76eacbfdca75fe0bab12ab9b156842641de07c38d3f66
2020-01-02 23:50:50 +00:00