]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoHandle recovering databases with reserved bytes at the end of each page.
dan [Fri, 14 Oct 2022 15:46:19 +0000 (15:46 +0000)] 
Handle recovering databases with reserved bytes at the end of each page.

FossilOrigin-Name: 52d0235ef3f21683daadf2343514f7b95a67c3589266f75c1e00e04f11dc6214

2 years agoAdd tests for detecting page size of databases.
dan [Thu, 13 Oct 2022 20:06:17 +0000 (20:06 +0000)] 
Add tests for detecting page size of databases.

FossilOrigin-Name: 31f9e2369fcf59032b7c4c9f5bfc85e7ef7c174003b0b9e2757dad5a4c79b370

2 years agoEnsure the page-size, auto-vacuum and other settings are copied into the recovered...
dan [Thu, 6 Oct 2022 21:00:23 +0000 (21:00 +0000)] 
Ensure the page-size, auto-vacuum and other settings are copied into the recovered database.

FossilOrigin-Name: 078520f2825bcb82d01b30209409e9bf8b6c99084c192345df41c9f531d08f51

2 years agoAdd code to determine the database page-size by searching for well-formed pages.
dan [Thu, 6 Oct 2022 17:20:12 +0000 (17:20 +0000)] 
Add code to determine the database page-size by searching for well-formed pages.

FossilOrigin-Name: 0dbd0ccef532e076fa82c9fad4dc9fe632c0ef43e3483cc288cbb7eca336a9b9

2 years agoImprove handling of corruption in the sqlite_schema table b-tree structure.
dan [Wed, 5 Oct 2022 16:58:28 +0000 (16:58 +0000)] 
Improve handling of corruption in the sqlite_schema table b-tree structure.

FossilOrigin-Name: 2be0dba12fb9b98cd9632f1ff3f30aeb29661a2e121b68c2f3335617b027797b

2 years agoMerge latest trunk changes.
dan [Tue, 4 Oct 2022 19:47:17 +0000 (19:47 +0000)] 
Merge latest trunk changes.

FossilOrigin-Name: b0feecaa84b88f534edb49056cf7e92256f4a687c8b4c44e1d1186709a304378

2 years agoBetter handling for databases with corrupt headers.
dan [Tue, 4 Oct 2022 19:43:12 +0000 (19:43 +0000)] 
Better handling for databases with corrupt headers.

FossilOrigin-Name: 17f68d803685405d880025134c71bac01077962d677f2902a608952d0b9cdb5a

2 years agoAttempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
drh [Tue, 4 Oct 2022 14:50:46 +0000 (14:50 +0000)] 
Attempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
Assert() statements added to prove that they behave as the documentation says.

FossilOrigin-Name: 3efa811251d4510a074231a1e0b667783cc5f90777466b9dcae675cd9892b423

2 years agoChange the name of the autoconf-generated configuration file from "config.h"
drh [Tue, 4 Oct 2022 10:35:10 +0000 (10:35 +0000)] 
Change the name of the autoconf-generated configuration file from "config.h"
to "sqlite_cfg.h" to work around a bug in a dependency checker, reported
in [https://twitter.com/josecastillo/status/1577136108097314816|a tweet from Jose Castillo].

FossilOrigin-Name: 897e187cad981126fc5f6ea8e382e937825af10b0c9589b0a23b9fbaa4ca58b8

2 years agoAdjust the --help output for speedtest1 to clarify that the argument to
drh [Mon, 3 Oct 2022 15:22:59 +0000 (15:22 +0000)] 
Adjust the --help output for speedtest1 to clarify that the argument to
the --cachesize option is in pages, not bytes.

FossilOrigin-Name: d7c2be6bdc3402e5a339d0f7b76d2c25f3a444dcbf54a77c1ccb790d1195a7cf

2 years agoCopy all of the fiddle-opfs changes to speedtest1 into trunk.
drh [Mon, 3 Oct 2022 13:56:52 +0000 (13:56 +0000)] 
Copy all of the fiddle-opfs changes to speedtest1 into trunk.

FossilOrigin-Name: f3d31c9982cab517a3907a28c571225cee614ee78375c70eb2efb9a2b6b4b042

2 years agoAdd the --vfs option to speedtest1.
drh [Mon, 3 Oct 2022 13:45:03 +0000 (13:45 +0000)] 
Add the --vfs option to speedtest1.

FossilOrigin-Name: aeb884029ac1c68f0d7361dda0a545cff19ed265b608c1e329a1926397c5c8a3

2 years agoMinor doc typo fix in sqlite.h.in.
stephan [Sun, 2 Oct 2022 20:13:46 +0000 (20:13 +0000)] 
Minor doc typo fix in sqlite.h.in.

FossilOrigin-Name: 372802aaa22a830bf498bb0d9561ae02b32e5e191c4d7d771ea152140f6685a1

2 years agoPerformance optimization in sqlite3_prepare() (discovered while working
drh [Sat, 1 Oct 2022 20:27:29 +0000 (20:27 +0000)] 
Performance optimization in sqlite3_prepare() (discovered while working
on the stmt-cache branch).

FossilOrigin-Name: cd494240cc6184bb028d1f1049086f57c0a71a43d7ed1405fd4205240e1b9e61

2 years agoReplace the Parse.disableVtab field with Parse.prepFlags for increased
drh [Sat, 1 Oct 2022 13:17:53 +0000 (13:17 +0000)] 
Replace the Parse.disableVtab field with Parse.prepFlags for increased
generality, a small size reduction, and a small performance increase.

FossilOrigin-Name: b7da0bcdf70e53ab1ec00a0694e17c7429e23bc6eb3f39b622d06a930aa2f6a3

2 years agoRemove one of the NEVER() macros added by [5166acf3f0040459] because it
drh [Fri, 30 Sep 2022 22:40:57 +0000 (22:40 +0000)] 
Remove one of the NEVER() macros added by [5166acf3f0040459] because it
is reachable after all.

FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417

2 years agoNew test cases in fuzzdata8.db
drh [Fri, 30 Sep 2022 20:59:09 +0000 (20:59 +0000)] 
New test cases in fuzzdata8.db

FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4

2 years agoFix a bug in the demoDelete fix from [d76a301e22e05722].
drh [Fri, 30 Sep 2022 20:53:36 +0000 (20:53 +0000)] 
Fix a bug in the demoDelete fix from [d76a301e22e05722].

FossilOrigin-Name: 7e761a02530ffbb055a766eb6c995f11fc2adbabb9a52502124f672fdcff0d10

2 years agoAdd NEVER() to two error-detection tests that were made unreachable by
drh [Fri, 30 Sep 2022 20:48:22 +0000 (20:48 +0000)] 
Add NEVER() to two error-detection tests that were made unreachable by
the previous check-in.

FossilOrigin-Name: 5166acf3f00404597e77910aee88920ab833af8447766f50bf4f70525606cf95

2 years agoBetter handle a case of database corruption where a b-tree page is one of its own...
dan [Fri, 30 Sep 2022 20:15:21 +0000 (20:15 +0000)] 
Better handle a case of database corruption where a b-tree page is one of its own ancestor pages.

FossilOrigin-Name: a24e46804893a7e6e8f3130abca882f9a3aa3b7b2b82aa39a0a20856172766d5

2 years agoImprovements to the "demoDelete" method in the demovfs, suggested by
drh [Fri, 30 Sep 2022 14:35:18 +0000 (14:35 +0000)] 
Improvements to the "demoDelete" method in the demovfs, suggested by
[forum:/forumpost/cad18961c2|forum post cad18961c2].

FossilOrigin-Name: d76a301e22e0572262917dfe9557a5051339a65416a473dd2d9989a49975403e

2 years agoFix misuse of the sqlite3_set_auxdata() interface in the ICU extension.
drh [Wed, 28 Sep 2022 19:14:01 +0000 (19:14 +0000)] 
Fix misuse of the sqlite3_set_auxdata() interface in the ICU extension.

FossilOrigin-Name: f25cf63471cbed1edb27591e57fead62550d4046dbdcb61312288f0f6f24c646

2 years agoProvide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
drh [Tue, 27 Sep 2022 16:35:06 +0000 (16:35 +0000)] 
Provide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
maximum memory allocation size.

FossilOrigin-Name: 584de6a996c78b8e41bdfcd05a8e2a3844664c6b4efedb5883c8b8af388462b5

2 years agoMake the legacy FTS3 code more robust against integer overflow during
drh [Tue, 27 Sep 2022 01:53:05 +0000 (01:53 +0000)] 
Make the legacy FTS3 code more robust against integer overflow during
memory allocation.

FossilOrigin-Name: 5517bc50988b5339c2fd071b29de1b5ca03037b0b635c3b112cf7108fab54d5f

2 years agoEnhance defensive mode so that it disallows CREATE TRIGGER statements if the
drh [Tue, 27 Sep 2022 00:56:45 +0000 (00:56 +0000)] 
Enhance defensive mode so that it disallows CREATE TRIGGER statements if the
statements within the trigger attempt to write on a shadow table.

FossilOrigin-Name: 3283bbd12a60f472ed03cb7c6209a605a3bf9f3d9083371e17840b56e8b3f559

2 years agoModify implementation of recovery to break recovery of the lost_and_found table into...
dan [Mon, 26 Sep 2022 20:51:16 +0000 (20:51 +0000)] 
Modify implementation of recovery to break recovery of the lost_and_found table into multiple steps.

FossilOrigin-Name: adedfd040bb2d1c2dcda0b91c6073f12953e45d9b860a8f217d990e861d66dfb

2 years agoAdd the SQLITE_RECOVER_SLOWINDEXES option, for specifying that indexes should be...
dan [Sat, 24 Sep 2022 19:54:49 +0000 (19:54 +0000)] 
Add the SQLITE_RECOVER_SLOWINDEXES option, for specifying that indexes should be created and populated along with tables, instead of separately at the end of the recovery operation.

FossilOrigin-Name: ad9dba9d1eae786575c7f31e34b342b6f5b26e719bbe27b61609cad8cfd0a505

2 years agoAdd sqlite3_recover_step() to header file sqlite3recover.h. Update the API docs in...
dan [Sat, 24 Sep 2022 19:17:20 +0000 (19:17 +0000)] 
Add sqlite3_recover_step() to header file sqlite3recover.h. Update the API docs in this file.

FossilOrigin-Name: 47f416153035d6bf0ae27587583d2957c87c02caecbd4e7f363bcb2bc27cf159

2 years agoUpdate things to use sqlite3_recover_step() internally.
dan [Sat, 24 Sep 2022 18:05:52 +0000 (18:05 +0000)] 
Update things to use sqlite3_recover_step() internally.

FossilOrigin-Name: f4b15aad3005237b7ac507eed2b9b07e0f5c9407ab28f2656a21c9845f13d35f

2 years agoInternal changes to the recover extension towards a step() style interface.
dan [Fri, 23 Sep 2022 21:01:10 +0000 (21:01 +0000)] 
Internal changes to the recover extension towards a step() style interface.

FossilOrigin-Name: 73926d5c8cd1ecece134b5a73b44ee1dfca74dc200606e3f009b06cdecf8cee9

2 years agoFix various compiler warnings in new code on this branch.
dan [Fri, 23 Sep 2022 11:40:43 +0000 (11:40 +0000)] 
Fix various compiler warnings in new code on this branch.

FossilOrigin-Name: ae49e9efde3012158061def6e0a8d993abbc5933514a21f84bc10f700f61b5e2

2 years agoMerge latest trunk changes into this branch.
dan [Fri, 23 Sep 2022 11:30:24 +0000 (11:30 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: e87fa70ab0f9b95bbcde18567f47906a222a3fd02b4f3c2903d2bb087d361b7c

2 years agoReduced and improved comments on the constraintCompatibleWithOuterJoin()
drh [Wed, 21 Sep 2022 18:21:31 +0000 (18:21 +0000)] 
Reduced and improved comments on the constraintCompatibleWithOuterJoin()
function.

FossilOrigin-Name: 38aaf26e082bd95df6b64df43e1772fe6e20c4eb71307dcd97559cac7f11f8f1

2 years agoThe RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
drh [Wed, 21 Sep 2022 09:54:41 +0000 (09:54 +0000)] 
The RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
query flattener which resulted in a performance regression for some queries,
as documented by [forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda].
This change removes that restriction (thus restoring performance) and fixes the
problem that RIGHT JOIN was having in a different way.

FossilOrigin-Name: 501609eddf2a46d51e8cd56477a22d4df142a166e78fe4322c0db11d1eed6687

2 years agoBreak out the decision of whether or not a constraint term is usable by flattener-omit-restriction-29
drh [Wed, 21 Sep 2022 00:16:59 +0000 (00:16 +0000)] 
Break out the decision of whether or not a constraint term is usable by
an outer join into a subroutine: constraintCompatibleWithOuterJoin().

FossilOrigin-Name: c7fbc9b0453050e2746af27e3a11e0c3701bef8c56da8e19173242c6ea3aff8b

2 years agoDo not allow EP_InnerON terms to be used on a outer join.
drh [Tue, 20 Sep 2022 22:19:13 +0000 (22:19 +0000)] 
Do not allow EP_InnerON terms to be used on a outer join.

FossilOrigin-Name: f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8

2 years agoAdd new test cases that (current) get an incorrect answer.
drh [Tue, 20 Sep 2022 21:07:52 +0000 (21:07 +0000)] 
Add new test cases that (current) get an incorrect answer.

FossilOrigin-Name: fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec

2 years agoNew test cases for query flattening when there are ON clauses and outer joins.
drh [Tue, 20 Sep 2022 19:45:04 +0000 (19:45 +0000)] 
New test cases for query flattening when there are ON clauses and outer joins.

FossilOrigin-Name: db55387b1972bc7bc6855bd3497af744a111e7d28d09893cd985fbb01be41bcc

2 years agoModify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
drh [Tue, 20 Sep 2022 19:22:17 +0000 (19:22 +0000)] 
Modify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
but was previously set to a NULL row using OP_NullRow.

FossilOrigin-Name: 1292d68caa7086610ddda343f3852e63de8da1eb66536ee4716b6529f5a31bc6

2 years agoRemove code that has been previously commented out.
drh [Tue, 20 Sep 2022 18:18:00 +0000 (18:18 +0000)] 
Remove code that has been previously commented out.

FossilOrigin-Name: 852b385a5de622aa32026824210d4bd23db52a4a8a697b83d22d6000edeba487

2 years agoMerge the fuzzcheck fix from trunk into the flattener improvement branch.
drh [Tue, 20 Sep 2022 17:43:40 +0000 (17:43 +0000)] 
Merge the fuzzcheck fix from trunk into the flattener improvement branch.

FossilOrigin-Name: 930a8c1561d0d5dc70dc5378edac77f79ac59ab6569b561de3dfb02f160c38c5

2 years agoUpdate the fuzz invariant checker to conform to the latest changes in
drh [Tue, 20 Sep 2022 17:21:54 +0000 (17:21 +0000)] 
Update the fuzz invariant checker to conform to the latest changes in
dbsqlfuzz.

FossilOrigin-Name: 8d8c124349d2a25200ace9a60d76751594b722468ad0c39d927a5d2c6e2464e0

2 years agoIs the query flattener restriction 29 (do not allow both EP_InnerON and
drh [Tue, 20 Sep 2022 16:57:49 +0000 (16:57 +0000)] 
Is the query flattener restriction 29 (do not allow both EP_InnerON and
EP_OuterON constraints on the same FROM clause term) really necessary?   This
branch explores what happens if we omit that restriction.  This is an effort
to address the performance regression reported by
[forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda] that is caused
by flattener restriction 29.

FossilOrigin-Name: 19270577ad1d08c9e6e5f0600396b8a1ccda9df1e67a0df845aee6b60437f379

2 years agoClarify comments that describe query flattener restrictions associated with
drh [Mon, 19 Sep 2022 19:25:15 +0000 (19:25 +0000)] 
Clarify comments that describe query flattener restrictions associated with
outer joins.  No code changes.

FossilOrigin-Name: 2647d73bb1876d01851f52cb3fd6af08a962ab336b6d51c160d27b1baf94f75f

2 years agoFix a minor comment typo. No changes to code or documentation.
drh [Mon, 19 Sep 2022 17:41:59 +0000 (17:41 +0000)] 
Fix a minor comment typo.  No changes to code or documentation.

FossilOrigin-Name: 8032db4ade66f70a102abb9d3a49e20620e204c45ad7a954a49d20403985bf07

2 years agoRemove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
drh [Sun, 18 Sep 2022 17:59:28 +0000 (17:59 +0000)] 
Remove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
true.  crash-32d9312f145cdce41613573f6431d9a3e439e3d7

FossilOrigin-Name: 90403759e1cf30f7c11fa8170d6df59a0dd138e1de59d2b60bec7ba15d74f67c

2 years agoFix windows builds of recover extension.
dan [Thu, 15 Sep 2022 03:54:52 +0000 (03:54 +0000)] 
Fix windows builds of recover extension.

FossilOrigin-Name: abcbb6abfe08fc590123f0aa1bd72cfdecc75908f078f1348dc0e957de98bf52

2 years agoInclude recovery extension in configure/make builds of testfixture.
dan [Wed, 14 Sep 2022 20:45:46 +0000 (20:45 +0000)] 
Include recovery extension in configure/make builds of testfixture.

FossilOrigin-Name: d2f4652144c4a54012a2176c178c5ade3463bd017515f472cfa8dafdde192df3

2 years agoExtra tests and fixes.
dan [Wed, 14 Sep 2022 18:57:46 +0000 (18:57 +0000)] 
Extra tests and fixes.

FossilOrigin-Name: deed5336931b23bb507c064d08e9899b33f04e4f7eee03beb8d7147eb4caa030

2 years agoFix recovery of utf-16 databases.
dan [Wed, 14 Sep 2022 16:37:59 +0000 (16:37 +0000)] 
Fix recovery of utf-16 databases.

FossilOrigin-Name: 5b05be0861f35804270fbd184ad4b89c23e98cc2fbd56b9e4fe6197daef5fe49

2 years agoAdd OOM tests for the recovery extension.
dan [Tue, 13 Sep 2022 20:40:57 +0000 (20:40 +0000)] 
Add OOM tests for the recovery extension.

FossilOrigin-Name: 9b6b4c7162439a889144edb561356afc66436db921a867c20871f0c556716502

2 years agoFix a broken error handling case in the recovery extension.
dan [Tue, 13 Sep 2022 19:47:01 +0000 (19:47 +0000)] 
Fix a broken error handling case in the recovery extension.

FossilOrigin-Name: 60089547e1fc77ecc02f207ebf75ee3160e5ff25f41d12e02e170fd7fde66602

2 years agoAdd tests. Deal issues surrounding aborting recovery from within the SQL callback...
dan [Tue, 13 Sep 2022 18:08:24 +0000 (18:08 +0000)] 
Add tests. Deal issues surrounding aborting recovery from within the SQL callback, and avoiding the pending-byte page.

FossilOrigin-Name: 4e97dd31f5240d9231167ae172a5116426c42177a1ed3c5422b9d51b762d5a87

2 years agoFix some problems with handling corrupt database in the recovery extension.
dan [Mon, 12 Sep 2022 20:02:33 +0000 (20:02 +0000)] 
Fix some problems with handling corrupt database in the recovery extension.

FossilOrigin-Name: ed318be8241981ef96334ba13d3201a717cc812a59aed64e3dc67f7e7e71854b

2 years agoMore tests for the recover module.
dan [Mon, 12 Sep 2022 19:23:50 +0000 (19:23 +0000)] 
More tests for the recover module.

FossilOrigin-Name: 37fb093b95c6b7d7ad07a275697df73b69f9fb5c5549aea8544b26e38f24833f

2 years agoNew run-time options to the speed-check.sh script.
drh [Mon, 12 Sep 2022 16:07:24 +0000 (16:07 +0000)] 
New run-time options to the speed-check.sh script.

FossilOrigin-Name: ff46bc9d2a844dde9dafa157114f4d9ee157205ca5c08ed9ee32f018de310e62

2 years agoRework recover extension code for readability.
dan [Sat, 10 Sep 2022 20:01:49 +0000 (20:01 +0000)] 
Rework recover extension code for readability.

FossilOrigin-Name: 1a2540960e40e3c8c622448fd3862e249bd463c29ae4ce5e39942e942533f60a

2 years agoFurther fixes to comments in sqlite3recover.h. Also rework some data structures in...
dan [Fri, 9 Sep 2022 20:44:56 +0000 (20:44 +0000)] 
Further fixes to comments in sqlite3recover.h. Also rework some data structures in sqlite3recover.c.

FossilOrigin-Name: 599d1f8ec2f9e24924a6f9e66c85664360c7b95531b07a4efe1dd8c096b3fc99

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 9 Sep 2022 17:50:29 +0000 (17:50 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 73c4c68d3b4c16caf8281dabddd7365d24691e5ee2da89b1783eca66bfbd9280

2 years agoHandle recovery of virtual tables by recovering each shadow table individually, then...
dan [Fri, 9 Sep 2022 16:25:19 +0000 (16:25 +0000)] 
Handle recovery of virtual tables by recovering each shadow table individually, then writing the CREATE VIRTUAL TABLE statement directly into the sqlite_schema table.

FossilOrigin-Name: 5f2d5ccd56c06c3468377126acfd4be39b79b05bb6fb09b674b2e185df143aa3

2 years agoUpdate comments in sqlite3recover.h.
dan [Thu, 8 Sep 2022 21:43:18 +0000 (21:43 +0000)] 
Update comments in sqlite3recover.h.

FossilOrigin-Name: 14164047c43e3ca43aa010c77ea00dfa85400e15645ee0f5b90a677898b6a836

2 years agoUpdate the shell to use the recover extension for the .recover command.
dan [Thu, 8 Sep 2022 19:22:29 +0000 (19:22 +0000)] 
Update the shell to use the recover extension for the .recover command.

FossilOrigin-Name: ae832e77084eddd696c80cb926d070a5db9d45dce34156a02522b3140e8f5e8b

2 years agoFix problems with recovering the sqlite_sequence table.
dan [Thu, 8 Sep 2022 17:42:33 +0000 (17:42 +0000)] 
Fix problems with recovering the sqlite_sequence table.

FossilOrigin-Name: 356d2209ea5f6b69ce15b62027c63419c2d039e52f01c74a3810a6317abf4fb0

2 years agoAdd new test file recoverclobber.test.
dan [Thu, 8 Sep 2022 11:04:23 +0000 (11:04 +0000)] 
Add new test file recoverclobber.test.

FossilOrigin-Name: cb4e950c472bd24a79a8505a7f8e4c3a0f7821648297d05cc760738b777d5149

2 years agoEnhance an assert() to impose for tighter constraints on the operation of pcache.
drh [Wed, 7 Sep 2022 20:11:22 +0000 (20:11 +0000)] 
Enhance an assert() to impose for tighter constraints on the operation of pcache.

FossilOrigin-Name: 42105eb43a916a7cd839fa6c582eaffaef17f50b23c3e05142400c379feb73c7

2 years agoAn improved technique for ensuring that the Rekey() operation does not
drh [Wed, 7 Sep 2022 19:28:18 +0000 (19:28 +0000)] 
An improved technique for ensuring that the Rekey() operation does not
overwrite an existing page number.  This approach does not change the
semantics of the underlying pluggable pcache and it is easier to prove
correct.  This replaces the changes at
[aadd38f99a3e5abc] and [81cff9f1955874aa].

FossilOrigin-Name: 7dbddde79e3ca1b81e00288616fc27434698ce6dcb47714728fce8602ae91f45

2 years agoEnsure that the recover extension properly escapes CR and NL characters in text mode...
dan [Wed, 7 Sep 2022 16:41:33 +0000 (16:41 +0000)] 
Ensure that the recover extension properly escapes CR and NL characters in text mode. Also that it holds transactions open on both input and output databases for the duration of a recovery operation.

FossilOrigin-Name: 6cca8913e703635ad89415a60fc84000ac188d9df43f45594b8ad87facb91d54

2 years agoTests and a fix for the SQLITE_RECOVER_ROWIDS option.
dan [Tue, 6 Sep 2022 19:38:06 +0000 (19:38 +0000)] 
Tests and a fix for the SQLITE_RECOVER_ROWIDS option.

FossilOrigin-Name: 1d5000f5718004110776ff58284d824854a93fe1cd1f6d8a4e8b8b0c2b2c3076

2 years agoAdd the tool/omittest-msvc.tcl script that will try to build using MSVC
drh [Mon, 5 Sep 2022 22:54:36 +0000 (22:54 +0000)] 
Add the tool/omittest-msvc.tcl script that will try to build using MSVC
using various compile-time options, to ensure that the compile-time options
all build without errors.

FossilOrigin-Name: 6b00ecb59fd303f7985902c35a46db9e729201d4beaedea46596b728d9e4b1c8

2 years agoGet the tool/omittest-msvc.tcl script working. msvc-omit-test
drh [Mon, 5 Sep 2022 22:53:24 +0000 (22:53 +0000)] 
Get the tool/omittest-msvc.tcl script working.

FossilOrigin-Name: 82b89f8a074858a81d841dfc26436e8d39ce4907b8f989eba4d848db16758303

2 years agoFix a problem with script mode and lost-and-found tables.
dan [Mon, 5 Sep 2022 21:22:35 +0000 (21:22 +0000)] 
Fix a problem with script mode and lost-and-found tables.

FossilOrigin-Name: 09ec588d2fe24dd321e88318fe90a9ae912cbc73c8a2d59a10c821625dd12d9d

2 years agoAdd a mode to output SQL statements instead of populating a database to the recover...
dan [Mon, 5 Sep 2022 21:00:22 +0000 (21:00 +0000)] 
Add a mode to output SQL statements instead of populating a database to the recover extension.

FossilOrigin-Name: 73058416e7da6581000898b7988a7010e2ce6632246f4c12b4398700c7744b83

2 years agoAdd a prototype for a script, similar to tool/omittest.tcl, that is designed
drh [Mon, 5 Sep 2022 20:42:01 +0000 (20:42 +0000)] 
Add a prototype for a script, similar to tool/omittest.tcl, that is designed
to test builds using MSVC to ensure they work with various OMIT options.

FossilOrigin-Name: b1e37a0bd31fa9f8e58c2859a80c23a682b4702eefab2c55b243f1e21d475d6c

2 years agoFix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.
drh [Mon, 5 Sep 2022 18:17:03 +0000 (18:17 +0000)] 
Fix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.

FossilOrigin-Name: f74a5ea8c986dc33d3afcda169c38abbe55728c56716cf9991a5e2ef7fc4917a

2 years agoAdd the SQLITE_RECOVER_ROWIDS option. To specify that rowid values that are not also...
dan [Mon, 5 Sep 2022 15:56:09 +0000 (15:56 +0000)] 
Add the SQLITE_RECOVER_ROWIDS option. To specify that rowid values that are not also explicit INTEGER PRIMARY KEY values should be preserved.

FossilOrigin-Name: 69cc9aba56a196bbd159bd24868aa5ccc60bed0dc612d09ed8a3ae898f156809

2 years agoAdd an option to assume the freelist is corrupt when recovering data.
dan [Sat, 3 Sep 2022 21:08:38 +0000 (21:08 +0000)] 
Add an option to assume the freelist is corrupt when recovering data.

FossilOrigin-Name: 253e498f5200b8b3e2bc309587af108dd1cec8a884b3d2a49d5406525c9a4b4c

2 years agoTake the freelist into account when recovering data that is not linked in to any...
dan [Sat, 3 Sep 2022 20:31:36 +0000 (20:31 +0000)] 
Take the freelist into account when recovering data that is not linked in to any tree associated with a schema entry.

FossilOrigin-Name: dbd1f1efb349a9c8886e42b3f07d3f4c576924136f111558c7294d0a272e415a

2 years agoFurther work on making the recover extension compatible with the .recover command.
dan [Sat, 3 Sep 2022 20:07:39 +0000 (20:07 +0000)] 
Further work on making the recover extension compatible with the .recover command.

FossilOrigin-Name: f2ac315844d8db1bd1c6950a4fef7c459ddd37cc21a8f3daafa5639fad8118e2

2 years agoEnsure the Pager.journalOff variable is zeroed if an error occurs while writing the...
dan [Fri, 2 Sep 2022 21:19:24 +0000 (21:19 +0000)] 
Ensure the Pager.journalOff variable is zeroed if an error occurs while writing the initial header to the journal file.

FossilOrigin-Name: da7af290960ab8a04a1f55cdc5eeac36b47fa194edf67f0a05daa4b7f2a4071c

2 years agoFix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].
drh [Fri, 2 Sep 2022 17:25:25 +0000 (17:25 +0000)] 
Fix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].

FossilOrigin-Name: 54251f81ebc43839cc97f91d2df4c320c1b96b5690cc11ce45b60c087c9becd6

2 years agoIf sqlite3PcacheMove() really performs a swap, then be sure to renumber the
drh [Fri, 2 Sep 2022 15:09:55 +0000 (15:09 +0000)] 
If sqlite3PcacheMove() really performs a swap, then be sure to renumber the
second page.

FossilOrigin-Name: 81cff9f1955874aade55daa94263f58f06d966bd51ad558755f92777069a7347

2 years agoEnhance the pcache1 implementation so that during an xRekey operation if
drh [Fri, 2 Sep 2022 14:29:54 +0000 (14:29 +0000)] 
Enhance the pcache1 implementation so that during an xRekey operation if
another page already exists at the destination, that other page gets moved
to the source key.

FossilOrigin-Name: aadd38f99a3e5abcf9bef49f4367752f163cc79500a28f812bb71969d7de419c

2 years agoMutex protect access to the sqlite3_test_directory and sqlite3_data_directory
drh [Fri, 2 Sep 2022 11:45:26 +0000 (11:45 +0000)] 
Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables.  See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].

FossilOrigin-Name: 8e6ad3a3e942a326cf16432e16d6596c7206c05b6f45cd0ff3a9b836bcfc9deb

2 years agoImproved mutex protection of the sqlite3_temp_directory and tempdir-mutex
drh [Fri, 2 Sep 2022 11:12:16 +0000 (11:12 +0000)] 
Improved mutex protection of the sqlite3_temp_directory and
sqlite3_data_directory global variables.

FossilOrigin-Name: ebbe9634d6dde9e097f61fb98a79111e46de422b7bbbd9ed3af7b6f22aacf5ec

2 years agoExperimental changes to put sqlite3_temp_directory behind a mutex.
drh [Fri, 2 Sep 2022 00:36:16 +0000 (00:36 +0000)] 
Experimental changes to put sqlite3_temp_directory behind a mutex.

FossilOrigin-Name: 5ee3515fbb88bf1ae5f8b507844f82dcc429380b6ebeab9b09b52b25ee60a60d

2 years agoFurther work on making recovery extension compatible with the shell tool ".recover...
dan [Thu, 1 Sep 2022 21:00:39 +0000 (21:00 +0000)] 
Further work on making recovery extension compatible with the shell tool ".recover" code.

FossilOrigin-Name: 8df7c7d0dcd1b2fcdad00e765a9868407f0ced02ac4432ee2cdf25d83b130759

2 years agoDefer deleting a transient SELECT statement associated with a flattening
drh [Thu, 1 Sep 2022 13:51:09 +0000 (13:51 +0000)] 
Defer deleting a transient SELECT statement associated with a flattening
of one arm of a compound SELECT until after the parse has completed.

FossilOrigin-Name: 1c4157c71cd1e062a9c2c79787d17e34e340f28ce1e40573851dfe174f5da7d7

2 years agoIn the query planner, add a heuristic that will reduce the cost of a full
drh [Thu, 1 Sep 2022 10:29:02 +0000 (10:29 +0000)] 
In the query planner, add a heuristic that will reduce the cost of a full
table scan for a materialized view or subquery if the full scan is the
outer-most loop.  This is shown to speed up some queries.

FossilOrigin-Name: 609fbb94b8f01d6792e5941ab23ce041313d359f6788c4dde6b1ca749ab49137

2 years agoAdd new files for an extension to recover data from corrupted databases.
dan [Wed, 31 Aug 2022 20:45:43 +0000 (20:45 +0000)] 
Add new files for an extension to recover data from corrupted databases.

FossilOrigin-Name: f8298eeba01cb5b02ac4d642c06f3801331ca90edea533ea898a3283981a9e49

2 years agoEnhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
drh [Wed, 31 Aug 2022 15:04:42 +0000 (15:04 +0000)] 
Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
overloads a page number and uses only the PENDING_BYTE page for temporary
storage.

FossilOrigin-Name: 5007742886bd20de20be3973737cf46b010359911615eb3da69cd262bd9a2435

2 years agoImproved comments in pcache1.c. No changes to code.
drh [Tue, 30 Aug 2022 16:54:41 +0000 (16:54 +0000)] 
Improved comments in pcache1.c.  No changes to code.

FossilOrigin-Name: dd017bb1b3e31c7692d29dc4865d6bda871e429978c8738a39160d0114e5bf9b

2 years agoAny function call can abort. Take this into account when deciding if a DML
drh [Tue, 30 Aug 2022 00:11:51 +0000 (00:11 +0000)] 
Any function call can abort.  Take this into account when deciding if a DML
statement needs a statement journal.  See
[forum:/forumpost/9b9e4716c0d7bbd1|forum thread 9b9e4716c0d7bbd1] for more
information.

FossilOrigin-Name: 5c95ae6c9b93b9bcf698bb1cad93b2da2e28121b35e7c539b1ddc0ef2de33cfe

2 years agoMore assert() statements in the page cache.
drh [Sat, 27 Aug 2022 16:11:00 +0000 (16:11 +0000)] 
More assert() statements in the page cache.

FossilOrigin-Name: 7c96a56c0d1de966844da6c5a84c0cd6066130a10724797ce6f228a9182d9b85

2 years agoEnsure that every pcache page always has either the PGHDR_DIRTY or the
drh [Sat, 27 Aug 2022 14:43:34 +0000 (14:43 +0000)] 
Ensure that every pcache page always has either the PGHDR_DIRTY or the
PGHDR_CLEAN bit set, even during transient page reshuffling during btree
balancing.

FossilOrigin-Name: e67f03c166277951725c194674c84da61c152a5820aa6df55a726f7dda838e92

2 years agoEnsure that sqlite3_prepare() inputs always have a semicolon terminator in
drh [Thu, 25 Aug 2022 19:29:35 +0000 (19:29 +0000)] 
Ensure that sqlite3_prepare() inputs always have a semicolon terminator in
speedtest1.

FossilOrigin-Name: c72756b0f2db30c622f00f43be9245d50e36049bd7740ee6332164f0c48f9c3d

2 years agoAdd the --script option to speedtest1.
drh [Thu, 25 Aug 2022 19:19:25 +0000 (19:19 +0000)] 
Add the --script option to speedtest1.

FossilOrigin-Name: 1c87d7c58d5aec83f9e2ae3771a81aa17cfae0cf06169025a5db085e2d5749f9

2 years agoRemove a NEVER() macro for a condition that is actually reachable following an OOM...
dan [Thu, 25 Aug 2022 13:32:55 +0000 (13:32 +0000)] 
Remove a NEVER() macro for a condition that is actually reachable following an OOM. dbsqlfuzz crash-6ef3cd3b18ccc5de86120950a0498641acd90a33.txt.

FossilOrigin-Name: b573e2cffa5fedc893ed30e76e47022b3617ac5583e1eb486afa810b2514c419

2 years agoAdd a mutex to the sqlite3_db_config() interface so that it is threadsafe
drh [Wed, 24 Aug 2022 17:59:00 +0000 (17:59 +0000)] 
Add a mutex to the sqlite3_db_config() interface so that it is threadsafe
when two or more threads call it on the same database connection at the same
time.

FossilOrigin-Name: 459ad8846ee1ee2d3b277a291c47121692bdf477e779b06e77be8338f62237a6

2 years agoFix an inefficiency in the ".dump" command when outputing large blob literals.
dan [Wed, 24 Aug 2022 11:51:31 +0000 (11:51 +0000)] 
Fix an inefficiency in the ".dump" command when outputing large blob literals.

FossilOrigin-Name: c055d05dbdfd4643d5052c6e6a736c78651fdfcd78f15f791af903df3814832d

2 years agoChange the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
drh [Tue, 23 Aug 2022 20:11:01 +0000 (20:11 +0000)] 
Change the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
unique.  Change to ppVPrev to save a few bytes and a few CPU cycles.

FossilOrigin-Name: 34b8ea31877ae8b40729d37b3f51ae7e15f38be841881ea4a37c9c8f0a52896d