Commit Graph

854 Commits

Author SHA1 Message Date
drh
34e139d3a3 Always use sqlite3_malloc64() in extensions, where possible.
FossilOrigin-Name: 6194f3b5314ef98b5d73060450de8e3497272494b47e6f96992453418894ded1
2026-04-01 16:56:48 +00:00
drh
f62cff6a9e Fix harmless compiler warnings in the csv.c.
FossilOrigin-Name: 6ac701f89e2ac8dfd18d041eb8c36a0c2b9fedc5618d3a95be794aecce5c59cf
2026-03-20 20:35:21 +00:00
drh
08eb5e9e51 Continue enforcing the legacy declaration-before-statement C-language rule,
since some downstream still uses it.

FossilOrigin-Name: 5c237f1f863a32cf229010d2024d0d1e76a07a4d8b9492b26503b959f1c32485
2026-03-18 22:31:56 +00:00
drh
169f68ed88 Improved defenses against mischief.
FossilOrigin-Name: 8bdc0d485e3ad0c7a1e818da66f106951d496b05cbe61d12c2c448f2f24b6d5d
2026-03-11 14:43:29 +00:00
drh
140cbff0d2 Remove an obsolete pragraph from the header comment on the fileio.c extension.
FossilOrigin-Name: 17613b72f34162ce22864621c519e883930c9f51a0a86afbf30ce664f95d7be1
2026-03-09 14:04:34 +00:00
drh
016a0ebedc Fix the completion.c TVF so that the xNext method reports errors it encounters
while running queries.

FossilOrigin-Name: eebcdcceef8a436e5fb1397cad6eb5bcf0722060fe1cd6acb26cdf1e86f07293
2026-03-08 19:31:40 +00:00
drh
456c7ea715 In the decimal.c extension, set a default MAX_DIGITS to 100 million.
Do not allow integer overflow of the N parameter to the internal
decimal_round() function.

FossilOrigin-Name: d0e23423d1bdd0482db4b74ef0fde2fbc2bbad02a7b92ba45a27ca57f4740e16
2026-03-08 18:50:35 +00:00
drh
b4f257f5e0 Fix another memory leak following OOM in the decimal extension.
FossilOrigin-Name: 414f6dbc09c2a3cf04ccdfd8f11eecb7ef781facff979ae4236a452913001391
2026-03-07 11:23:11 +00:00
drh
6142524b70 The optional SQLITE_DECIMAL_MAX_DIGIT compile-time option limits the
maximum number of digits that the decimal extension will operate on.

FossilOrigin-Name: 4214485b2fe4b95d9440008158d458b4b957a111f201965de1a518623589fd79
2026-03-07 02:36:39 +00:00
drh
3866d01907 Reenable the is_base85() extension function that was disabled
by [af18b68978ec9b1f].

FossilOrigin-Name: be07c16e3a7d28b95bea4b987a880d5b4b2b44d9a31ac5b48caa5b6c6dc5bec3
2026-03-07 00:14:36 +00:00
drh
02d9860c8e Fix another NULL ptr deref following OOM in the sha1 extension.
FossilOrigin-Name: c4843e4cce71acb1e3743c45e0ee8cf62e91c39b57cec4f356bf7a4a10f81352
2026-03-07 00:10:34 +00:00
drh
7f6236bed1 Fix a NULL pointer dereference following OOM in the sha1 extension.
FossilOrigin-Name: 530b3f97ca4e8b1d263266855743b0d57d048104a6c3bed6c4d7958985767bc6
2026-03-07 00:03:47 +00:00
drh
56b571780e Fix a NULL pointer dereference following OOM in the decimal extension.
FossilOrigin-Name: de37f30b2100e0c249e5c0853d6af90cd3c2069899747dcf0889e6a3d6b94061
2026-03-06 23:58:58 +00:00
drh
84334c941a Fix a memory leak following OOM in the completion extension.
FossilOrigin-Name: ff5b1efbf80875a82b3707b56440551eb6f68a899ade27363bc62872fe46fd75
2026-03-06 23:56:03 +00:00
drh
8f65da4574 Fix a memory leak in the decimal extension that follows an OOM.
FossilOrigin-Name: 8d59e47e7ae0aae01cb25c6c054cf9a4d9651e858bc0dd1a0e2a013ec6579012
2026-03-06 23:37:45 +00:00
drh
1bf79ca445 Rename the initializer functions for base64() and base85() to include the
number at the end.

FossilOrigin-Name: af18b68978ec9b1ff732505bfb92bb65e4f7381b904123f42c638b747569fa28
2026-03-06 22:09:39 +00:00
drh
7c483444a1 Fix a NULL pointer dereference in the (undocumented) two-argument version
of the decimal() extension SQL function.
[forum:/forumpost/fa9c2dc83f|Forum post fa9c2dc83f].

FossilOrigin-Name: a0266351df8700383d50c2ef2d179dd82b0e0fd7fc70d05a91d5e4e845983b46
2026-03-06 21:31:07 +00:00
drh
7fa89ea907 Change some sqlite3_realloc() calls into sqlite3_realloc64().
FossilOrigin-Name: a391f5646926787fd9a004225ea406b61d20f282c852c0282fd26cada644b601
2026-03-02 15:06:59 +00:00
dan
33478099c9 Fix a possible 9-byte buffer overread in the zipfile extension hit when processing a corrupt zip file. Forum post [forum:/forumpost/721a05d2c5 | 721a05d2c5].
FossilOrigin-Name: 5db21813d126554d80db903be6d36ab6c1f73f9135a54af6dcfcfce0bcc18e68
2026-03-02 11:22:28 +00:00
drh
9235f9b049 Enhance the realpath() SQL function in the fileio.c extension
so that it works ever for pathnames that do not exist.

FossilOrigin-Name: 27a5735fb1e194d763ab9fdb933fad4f694fb2f8ad19205d17ac81caebd82548
2026-02-23 11:44:30 +00:00
drh
95fe5b9c38 Improved implementation of realpath() in the fileio.c extension that does not require
the last element of the path to actually exist.

FossilOrigin-Name: 4df4999484d9008d8af3c9c340810e0cf5f57161ba053ed5501276b450577039
2026-02-23 00:57:00 +00:00
drh
9bc017423c Add the realpath() SQL function to the fileio.c extension. And clean up
the UTF8 handling on the Windows side of that extension while we are at it.

FossilOrigin-Name: 8bb8941930378b436f1353603be194644568b55fe347475be0caddddad40efa3
2026-02-22 20:44:52 +00:00
drh
f8681fb638 Fix a harmless warning in the decimal extension.
FossilOrigin-Name: f16c7c4000f2b992f7245dcaf669f13ed464579f8894f3c16842eebf41285c70
2026-02-21 20:20:06 +00:00
drh
62546d4b1f In the decimal extension, an optional second argument to the
decimal() and decimal_exp() functions rounds the value to the
number of significant digits specified by that argument.

FossilOrigin-Name: cb24edf1afc3f9083a4963c5fe232933eccc7c0cb8872aa5fcd336d226b885ef
2026-02-20 16:21:58 +00:00
drh
d447df4205 Add new functions ieee754_to_int() and ieee754_from_int() to the
ieee754 extension.  No changes to the core SQLite.

FossilOrigin-Name: 8660d3e94cbe892693554df282bce0fa8c7aedbc5e020cab647cbbff3d7e55b7
2026-02-20 14:20:33 +00:00
drh
7549e784a8 Minor fixes to tmstmpvfs.c.
FossilOrigin-Name: 091bd90ed5a6a326fd532e93bd17903e052476da14dc6aee2599a9acf75a3276
2026-02-17 14:28:18 +00:00
drh
c652e34317 Correction to date/time computations associated with the timestamp-vfs.
FossilOrigin-Name: b67889e4f17c3280f839ee7045256cc47d6ce3ed60d880925e3d30f9ebbcf3ff
2026-02-10 19:33:11 +00:00
drh
c4e7964fd6 The tmstmpvfs.c extension should not modify the content of pages going into
the WAL file, as that would corrupt the page checksum used for recovery.
Instead, only insert timestamp information as content is written into the
database file.

FossilOrigin-Name: dabaeeb1dab82eaea2449658b9c4c74af0058e5a64a076dab046902c6efac292
2026-01-27 16:18:35 +00:00
drh
87efa1bd79 Additional usage notes added to the header comment of the tmstmpvfs.c
source file.  No code changes.

FossilOrigin-Name: d1b8e7740bee13a8cf199c6477ee20a4f8bcbbd9ec4096bcdc05a996fadf0d56
2026-01-27 12:50:52 +00:00
drh
389926bd3c Enhanced documentation in the header comment of tmstmpvfs.c.
FossilOrigin-Name: 3d37da3cb5943a61f528e3002c4c3ac3d41e871d742d8e603bffcc4bc5bd42fd
2026-01-27 12:02:02 +00:00
drh
f202df5857 Fix frame number computation in the log generated by tmstmpvfs.c.
FossilOrigin-Name: 57fda9dd85f0de8c5d4a4d8015e67982d73ab96ad6f1cd590a48d8995dc28140
2026-01-27 11:19:49 +00:00
drh
e17a469d74 Enhancements to tmstmpvfs.c: (1) Use the exact same timestamp on logfile
entries as on the pages that control, where appropriate.  (2) Include the
WAL frame number in ELOG_CKPT_PAGE logfile entries.

FossilOrigin-Name: fcf16297850abf5186b0d414b4f31d4b515925ef5cca5e7d7d84984c26160d00
2026-01-26 21:20:28 +00:00
drh
35b9709d46 Fix integer overflow problems and error reporting memory leaks in
the zipfile extension.
[forum:/forumpost/2026-01-13T00:09:06Z|Forum post 2026-01-13T00:09:06Z].

FossilOrigin-Name: 8e656a483557bc5385219d560b9155c232e7dc9d62642249abc879fb37bacd2a
2026-01-13 02:35:19 +00:00
drh
9a341c1edb Avoid unsigned integer overflow in the delta_apply() extension function.
Not part of any standard deliverable.  
[forum:/forumpost/d41879b367c7f7ec|Forum thread d41879b367c7f7ec].

FossilOrigin-Name: b354dd12c25c820c04b08e0be4ba8c095fc648dfb4b71345aacce50a17fd269a
2026-01-12 19:56:00 +00:00
drh
6444f694a6 Improved documentation (in the header comment) for tmstmpvfs.c.
FossilOrigin-Name: 70b1da718c176b8eb154fe087af4352eb6f55c9c0d1f09fc625d073d9f8075f4
2026-01-12 14:45:55 +00:00
drh
c34d561940 Change the name of the log file for tmstmpvfs.c to be an ISO8601 date/time,
for improved readability and situational awareness.

FossilOrigin-Name: 66018b85a92db2f3b6b15f7c5c0d54bac890f8e50a1839c08857507c39ec4af7
2026-01-08 18:55:49 +00:00
drh
5df3efe6f4 Fix an off-by-one error in the page number of ELOG_CKPT_PAGE log
messages in tmstmpvfs.c

FossilOrigin-Name: 6fafd010de2d9820f77ee6d2a5f0a7ab1260872d09e95b6932c959ef017aaa77
2026-01-08 17:52:42 +00:00
drh
403c153dfa Minor bug fixes in tmstmpvfs.c, showdb.c, and showtmlog.c.
FossilOrigin-Name: 1fee8265f7eab649ee8b28456c37d95198f5cde54e905154e3eccc0b328ece9a
2026-01-08 15:25:04 +00:00
drh
c0420cd8e4 Add the showtmlog utility for decoding the tmstmpvfs log files.
Fix tmstmpvfs so that it records timestamps in milliseconds since the
Unix epoch, not in JDN milliseconds.

FossilOrigin-Name: 762d3cbf06218f1010425a98a71ebf7623b84b45a90e6419b7dec7f10ad0c5a5
2026-01-08 12:22:50 +00:00
drh
8a2be4b739 Add the tmstmpvfs.c extension to trunk. It is not a part of any deliverable
and can easily be removed later, if found to not be desirable.

FossilOrigin-Name: 869f306592a86d2a78f00266c615f033cd2318a7bff0a97b3dcdd3348d99fc66
2026-01-08 00:41:12 +00:00
drh
ef5d9952eb Fix the static build.
FossilOrigin-Name: 4e1a1b6aeffaa5b8c11e165803c6d33becabd1f646f39e4309dfba6892fd4bd6
2026-01-07 19:06:11 +00:00
drh
0b5f8766fd Improvements to logging. Better log-file names. Log files are in a
subdirectory named after the database.  Only connections that write to
the database create logs.  Better documentation in the header comment.

FossilOrigin-Name: 5b1cf0fe73ba1a40fe4cd8f5f6e8ee5b471f96b60aff52c03c045ad6514c363a
2026-01-07 18:45:23 +00:00
drh
8fe0385661 Documentation tweaks.
FossilOrigin-Name: b10b0aa7658a04b9354ca09a2dcb807eecd9421451537f3230ba5f47269ec5c1
2026-01-06 21:18:42 +00:00
drh
d3c9cce43c Enhance the timestamp-vfs prototype so that it also keeps an event log.
FossilOrigin-Name: f087c6c0cdd542ec24b4668fff9cb434f46caf554f8856a49fd062ab3f72014e
2026-01-06 20:51:06 +00:00
dan
55f258bd27 Update the regexp extension so that the "-" character may be escaped with a backslash. Forum post [forum:c5e7358f82 | c5e7358f82].
FossilOrigin-Name: 80013129361fb81ce5db1f6390cad640c2cb547e5ba16724dfb55d0aceecdf6d
2026-01-05 18:29:07 +00:00
drh
bb4428e605 Add the experimental tmstmpvfs.c extension that adds a timestamp and other
debugging information on each page of a database as that page is written,
if the database is configured for exactly 16 bytes of reserve space.

FossilOrigin-Name: 703e593dfc92676a2d44c67ca8282a78a1943b9c1e3f2447c0a9917d70a383c4
2026-01-05 17:28:33 +00:00
drh
02e38b4d21 In the (completely unused, as far as I know) btreeinfo.c extension (not
a part of any standard build) do a better job of detecting corrupt database
files and provide better error messages when corruption is detected.
[forum:/forumpost/e66a458339|Forum post e66a458339].

FossilOrigin-Name: 326d29ac7ecd933d6fca80d3d538783ed46939e7bc6e3aa60ded4b619aa73730
2025-12-31 19:45:45 +00:00
drh
6789770822 Use 64-bit integers to track memory allocation sizes in the CSV extension.
[forum:/forumpost/e66a458339|Forum post e66a458339].

FossilOrigin-Name: f293a2b3ffcfe20fcda954bd31e88bbfcba18d007e9b5f29a473983f6030f2ce
2025-12-31 18:30:45 +00:00
drh
f8bd7df996 Use sqlite3_malloc64() in all places in the compress.c extension to avoid
integer overflow.
[forum:/forumpost/2025-12-31T01:04:00z|Forum post 2025-12-31T01:04:00z].

FossilOrigin-Name: 7ceaf1f0c3d9b96d2224ce6526fb3092b9e1673573e3d7dd898b2a135e23027d
2025-12-31 01:19:51 +00:00
drh
03380a55a5 Fix a typo in [0819fe670f9ceec7] that lead to incomplete protection against
buffer overflow in the zipfile extension.
[forum:/forumpost/2025-12-30T23:57:19z|Forum post 2025-12-30T23:57:19z]

FossilOrigin-Name: a6abbadacbb88c1ddcc236b40fb34eddf3bb0891189bd00a5af8d34b42871967
2025-12-31 01:01:14 +00:00