Commit Graph

27885 Commits

Author SHA1 Message Date
stephan
2c3973fdff /fiddle: before resetting a db, roll back any transactions (resolves problem reported in [forum:0b41a25d65|forum post 0b41a25d65]) and remove an obsolete/broken reference to a long-gone API which could cause initialization to fail prematurely.
FossilOrigin-Name: ee164ca73cf4151b1a1bf351729afa9b0ec95bd5004a5d5bfce3ed46268bfbf3
2024-03-05 06:31:37 +00:00
drh
18281494a2 Fix a compiler warning in date.c. Update makefiles to include all necessary
dependencies for building shell.c.

FossilOrigin-Name: 178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680
2024-03-04 18:22:18 +00:00
drh
4cf953731f Change test results in corruptC.test to account for the added detail in the
output of "PRAGMA integrity_check" from [b736519d3d2e93c7].

FossilOrigin-Name: 0d19eeaafb296aad212ee4f55a0f6df8c7c5185b14d7f7f49c020fe4cbe370c1
2024-03-04 16:44:37 +00:00
drh
90170503b4 Fix harmless compiler warnings in the increment integrity_check extension.
FossilOrigin-Name: 596668e6625208ff5d2ffbb4e0530530ebb3a400efa0df54bad1d91953e32694
2024-03-04 16:18:40 +00:00
drh
3f273db39b Adjust date/time functions so that they do a better job of keeping track
of whether the current time is UTC or localtime, and no-op the 'utc' and
'localtime' modifiers accordingly. See
[forum:/info/e7a939e074|forum post e7a939e074].
Also add the datedebug() function, available
only under -DSQLITE_DEBUG, for improved visibility of the DateTime object
during debugging and testing.

FossilOrigin-Name: dc569683748354a6db83438904422e802d3ea780775c48da85b474fff03ca8a1
2024-03-04 13:58:09 +00:00
drh
8d25d07d50 Fix assert() statements in date/time computations: The month and day numbers
can be zero if an error has been seen.

FossilOrigin-Name: fc773f6c76ec114be8b6e25b13885acb5adcc9d052dca0d8d0ff94e2a0743d64
2024-03-04 11:12:15 +00:00
stephan
2775f10ebc Document why the wasm build does not use Emscripten's -sSTRICT=1 flag and account for a behaviour change in emsdk 3.1.55 regarding the HEAPxyz symbols.
FossilOrigin-Name: f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7
2024-03-04 09:56:47 +00:00
stephan
bae55a7685 When warning about multiple invocations of JS's sqlite3ApiBootstrap(), use the warning logger installed by the first invocation, rather than console.warn.
FossilOrigin-Name: d162af2d9941cd8c53e3928efb42aaaf4e59454f7d39aebf980a30b1427ea75b
2024-03-04 09:23:52 +00:00
stephan
e6af60c14f After wasm bootstrapping has read the optional global-scope config objects, delete those objects because any further changes would not have any useful effect. Expand the docs regarding the sqlite3ApiBootstrap() config object and explain the necessary evil of a separate global-scope object for that configuration.
FossilOrigin-Name: e6b14f73136aae4c1a92d6d6ab8c5d1510db5244d0b0f168eed5b4b257c99064
2024-03-04 06:54:41 +00:00
drh
aefa7afddb Back out the previous change. Replace it with new date modifiers "ceiling"
and "floor".

FossilOrigin-Name: f0831cced2c919e409214d936c81473ae321a98c5bd78b5b729c1269bf71bc45
2024-03-03 20:15:36 +00:00
drh
ebc14e409f New date/time modifiers "mnth" and "yr" work like "month" and "year" but
resolve day-of-month overflow by truncating rather than rolling over into
the next month. [forum:/forumpost/232d1abb5d|Forum thread 232d1abb5d]

FossilOrigin-Name: 5d392c16bb5658bc92f60d250ab82c45cc109e32d58a073498c9a487b8625e96
2024-03-02 21:02:41 +00:00
drh
f52afaf738 Change the magic time-interval names that do truncate-to-same-month to be
"mnth" and "yr" - "month" and "year" without the vowels.

FossilOrigin-Name: 296b46c529d79385d7f4db2c789254a992c01ff66fe8ba6d3a3ce4aaac0203fb
2024-03-02 20:50:56 +00:00
drh
6964005847 Proof-of-concept for new time-interval operator "pg-month" and "pg-year" that
use the truncate-to-month algorithm for month overflow instead of the
wrap-to-next-month algorithm that is used by SQLite by default.

FossilOrigin-Name: b606c0965788f56547435c9318b60e32990877e14a9640d887f33f39d1bdc7c3
2024-03-02 13:38:46 +00:00
stephan
91d7bd8ec7 Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].
FossilOrigin-Name: 803481f25020f3c25941f1e7d1a8071937820dea951e8798198b0b0fa3fb48ce
2024-02-29 10:55:02 +00:00
stephan
087e6c9ada Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].
FossilOrigin-Name: 29f94610dc8319709b8d3726a60e2a7a33ffbf4998c681f772da26c9701cc0b0
2024-02-29 03:45:18 +00:00
drh
09a71d8d44 Add in a VdbeCoverage() macro needed by STAT4 that should have been part of
check-in [63ef234e88857a65].

FossilOrigin-Name: d51c699ae413215d534f954c129691ef5d95d540dc5d4304cbba576c976d931c
2024-02-28 15:32:32 +00:00
drh
8597eee119 Always convert 32-bit integer literals into EP_IntValue notation, even if
they contain "_" separators.

FossilOrigin-Name: 2dfc427f676255cbe189a26bfec2405d41d31ccc4512c55b31e6e633261d7a23
2024-02-28 01:12:21 +00:00
drh
b542933cba Fix an eputf() macro without its argument in the CLI.
FossilOrigin-Name: c2f5e257d2cfb91341f5261ed3924dc4ec2a6f854f3692fb416043f5c654a963
2024-02-27 20:19:32 +00:00
drh
6324cdfdcd Add an assert() to help scan-build recognize that a variable is initialized.
FossilOrigin-Name: 10d26f1ee8e7624cbb957332b4397d2f1fcdaf916acec93077f2ddd33e01f1d8
2024-02-27 19:57:31 +00:00
drh
2aea6083bd Adjust a VdbeCoverage() macro in PRAGMA integrity_check to account for the
fact that arguments to the OP_Eq opcode used are never NULL.

FossilOrigin-Name: 759ccea3f6e21493c0153f884b601988efd59e409b113b28f8cf23f59a74e418
2024-02-27 16:36:40 +00:00
drh
39670a5345 Remove unreachable branches from the PRAGMA integrity_check enhancement of
[b736519d3d2e93c7].

FossilOrigin-Name: 6d02fb233fb86f9907cc374d06a7ed71a638091d6e75abc199001c42eab51e5c
2024-02-27 15:33:54 +00:00
dan
8732fce985 Ensure memory cells are properly freed before they are overwritten by OP_IntegrityCk.
FossilOrigin-Name: e50acaf934f44f8833bc588e0ae1abd59df907b9a42d4cafd5518427a8c7b627
2024-02-27 14:31:31 +00:00
dan
f8dc7d20f7 Have "PRAGMA quick_check" compare the number of entries in tables and indexes.
FossilOrigin-Name: b736519d3d2e93c76fa36253143f2664b9dd12e26acba555f0bf9c4d44705499
2024-02-27 11:03:10 +00:00
stephan
5b985fee64 Extend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to the generated sqlite3.c, as discussed in/around [forum:ccda88cf6f1754c5|forum post ccda88cf6f1754c5].
FossilOrigin-Name: 61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8
2024-02-27 11:02:31 +00:00
dan
1ffaa03adc Allow "_" characters to appear between any two digits in an integer, real or hexadecimal SQL literal.
FossilOrigin-Name: 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b
2024-02-27 10:52:41 +00:00
stephan
32888c2b30 Bring the extra-src branch up to date with the trunk.
FossilOrigin-Name: 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb
2024-02-27 00:58:51 +00:00
drh
f79b0bdcbf The quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
-9.0e+999.  See [forum:/forumpost/6675b25108|forum post 6675b25108].

FossilOrigin-Name: 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd
2024-02-26 22:28:21 +00:00
drh
7c6433cfff When inserting a 3-byte cell into a btree, ensure that the extra padding byte
is 0x00.  This is not necessary for security, as far as I can tell, but it
seems like a reasonable precaution.

FossilOrigin-Name: 5766f1279dab91e030d4dcf5133659e5cedf914a1628ccf00d67d8e50a9957fd
2024-02-26 15:27:33 +00:00
dan
09e1900cdc Add the intck extension. For performing incremental integrity-check on a database.
FossilOrigin-Name: 141d8bb059f8987d05d18327b97c4d36e98258f657b41a3d4d8877fe8b4e72e3
2024-02-26 12:16:02 +00:00
drh
1103eb423e Fix header comments on test scripts.
FossilOrigin-Name: 9fe9670c977ce7ad2c19657783a63998769dbb7741a587889c72ecc04d895793
2024-02-26 11:51:21 +00:00
drh
f286ad9211 Remove a local variable from sqlite3IntFloatCompare() that was being optimized
out anyhow, in order to get back to 100% MC/DC.

FossilOrigin-Name: 52b13d6acbb738b9281f7dd44edd6c3c9585d22d98b1951b7059534fbd16fac0
2024-02-26 11:43:44 +00:00
dan
afeec79847 Merge latest trunk changes into this branch.
FossilOrigin-Name: b6371ff9f5c3d4e87a5b1127a82970202f74c790b828dda20df88dd727bcc9b4
2024-02-26 10:56:54 +00:00
drh
dfd991c3b9 Make sure key comprisons are done correctly if the index key contains NaN
values that have not been shifted into NULLs.  That can only happen due to
database corruption, but we need to deal with it nevertheless.

FossilOrigin-Name: 7e4c743f9e6ef33500795543e6db9a77c533025bf00c2ee97abd433a3871b5a1
2024-02-25 21:30:33 +00:00
drh
7598e7d70e Add two GIFs that contain the feather logo.
FossilOrigin-Name: 5f21e6a8ee709d8c5ec12c45e8dc702a7d0bb041f31b5715e28cd904dfd566b0
2024-02-24 19:58:15 +00:00
dan
9c59c87448 Add further tests for the intck module.
FossilOrigin-Name: c253e276b29de28a18270d01b60d95157ce3fc4b37e246d991f9119d26e718d7
2024-02-24 16:26:15 +00:00
dan
ee299cc7d4 Add tests for the new code on this branch.
FossilOrigin-Name: 351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87
2024-02-23 20:51:06 +00:00
dan
645f21f15b Add the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.
FossilOrigin-Name: cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9
2024-02-23 18:21:51 +00:00
stephan
b088e892a0 Typo fixes [forum:c19bbf245d|reported in the forum]. No code changes.
FossilOrigin-Name: 67d8bae0f695c0839e724c1aadea0a22f736fdd9664d40a29b4d82c91fb89ab3
2024-02-23 18:02:31 +00:00
dan
5956d1d942 Fix detection of surplus index entries when all indexed fields are NULL.
FossilOrigin-Name: 5f310fb7be450c96f01c21e6fd1377d4a274784377d0bd811922ab63e612bd11
2024-02-23 17:10:39 +00:00
dan
1545243368 Fix problems with resuming integrity-check operations on indexes with mixed ASC and DESC columns, and on indexes that contain NULL values.
FossilOrigin-Name: 0f68b35a000ef9f4691c59797c66ed6c3435fc5c503e9d24f891afec6aceeada
2024-02-23 15:13:53 +00:00
mistachkin
f7ad684c5a Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: e5db08993127dfc18cc2b621a13cbfef52974f0f504f4d8208093bfad1ffdcc5
2024-02-22 18:15:08 +00:00
drh
0b8c3126f4 Fix debugging code so that it compiles on MSVC.
FossilOrigin-Name: ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3
2024-02-22 00:50:54 +00:00
dan
639db50a02 Fix various issues in sqlite3intck.c.
FossilOrigin-Name: 8a7bfa74525a495f45b1ea212b1718633b637295090d514dd777f9263477d514
2024-02-21 20:58:48 +00:00
drh
9591a9f069 Fix typo in comment. [https://fossil-scm.org/forum/forumpost/cc20266bf2|Fossil forum post cc20266bf2].
FossilOrigin-Name: 7e3c46eed1290964a3e25662686c6ba1149bf8687d05719b684772e65d660c09
2024-02-21 20:21:46 +00:00
dan
6a00f707e8 Simplify the way the restart key is saved internally by the intck extension.
FossilOrigin-Name: 0e39962baae8a82a3021077676b792ac30c79426bcd8c075b5e92bee55e8c3a5
2024-02-21 19:31:00 +00:00
dan
b783f56c58 Add documentation to ext/intck/sqlite3intck.h.
FossilOrigin-Name: 4cc19bd74f05fe92658cc392a1d1afa173d93181a77303af6bc5684436ae832e
2024-02-21 19:17:45 +00:00
dan
b2897c221d Ensure intck tests are run by testrunner.tcl.
FossilOrigin-Name: 11d6816c060b6edb9cd61f29297ab95e75e2b46f29c0a796820d94fc13586f6d
2024-02-21 16:15:50 +00:00
dan
ebd99d5708 Merge trunk changes into this branch.
FossilOrigin-Name: 63e8846ac1dc1cf1f7071c4634ccbfec3c13560db6afec376cd91515b62430d3
2024-02-21 16:12:23 +00:00
dan
eb715f022f Have the intck extension better handle corruption at the b-tree layer.
FossilOrigin-Name: ecd775d108f77d39a1303316c1e0f0b0ae3ffc5218222e1ebfe2ef6783829b85
2024-02-20 20:18:02 +00:00
dan
cfcb3b9208 Use fewer cycles to generate the "next key" value used by sqlite3_intck_suspend() function in the intck extension.
FossilOrigin-Name: 95f01426f948cf435d0b400dc7ae06fa699eee32cff498fe77e74a1257a4e09b
2024-02-20 18:17:06 +00:00