Commit Graph

31377 Commits

Author SHA1 Message Date
drh
7fa89ea907 Change some sqlite3_realloc() calls into sqlite3_realloc64().
FossilOrigin-Name: a391f5646926787fd9a004225ea406b61d20f282c852c0282fd26cada644b601
2026-03-02 15:06:59 +00:00
drh
c1454ee833 Remove the experimental and incomplete ext/repair extension, to prevent AIs
from scanning the (incomplete) code and reporting bugs against it.

FossilOrigin-Name: 213b1c6608af4b3e9d6e0d8de6432cc6857931427baf4beac1e0a4294e4dc6ce
2026-03-02 13:44:04 +00:00
drh
ea6b2a87d1 Disable test shell1-5.0 as it is causing a use of initialized deep inside
of TCL.

FossilOrigin-Name: 440bd6091e3767f0a2f42ffdc92ca5e4736c0a73324fdd15397c3b5dbbc31fb8
2026-03-02 13:43:08 +00:00
drh
f270460366 Use only 64-bit memory allocation in FTS5. Fix for UAF reported by
Zijie Zhao.

FossilOrigin-Name: e8976d5041c929675772039b7a8fc4ff0b609537d86f9aa6e445ecd512a10673
2026-03-02 11:41:48 +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
93ad2e083e The intck01.sql test should only be run if virtual tables work.
FossilOrigin-Name: 641d6f31a7f7b4901061e24d4e624da5ed92282e79771bb019b82a882e5d1ae9
2026-03-02 00:06:02 +00:00
drh
ffaf9110f6 More floating point conversion test cases.
FossilOrigin-Name: 44a736a700ab12b398873400dc06cd334817842b4fa08bf8070a9ad6dbff0b51
2026-03-01 23:23:52 +00:00
drh
7e4e866baf New floating-point test case.
FossilOrigin-Name: f353399932e9797198e635405a594c2987850070e3f9aee87a05c5a65d4c1e00
2026-03-01 23:01:17 +00:00
drh
e293b2d835 Fix an OOB read in the incremental integrity-check extension.
FossilOrigin-Name: abecc8e388e294311aa0b572e0a984b8ddad2afbf829c1246e1682fa549c8fac
2026-03-01 22:36:02 +00:00
drh
83de60bd7b Simplified rounding logic in sqlite3Fp10Convert2().
FossilOrigin-Name: 8ac63ebc5c04ba555bbf0d878a70e25deba5fcc75ff44c464600b92c27e5dcb0
2026-03-01 20:22:08 +00:00
drh
a000db9754 Code changes in sqlite3Fp10Convert2() for easier maintenance. Does not
affect the generated machine code.

FossilOrigin-Name: 21c8fc7100e23b632b77934cbbafb98dfd3e6e73bab702446ef6345b378c9d36
2026-02-28 20:22:10 +00:00
drh
7ac310d0c6 Improvements to power-of-ten computations used for text ↔ binary64
conversions.

FossilOrigin-Name: 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0
2026-02-27 22:59:46 +00:00
drh
afaf7ea2e4 Minor simplification to the text→binary64 conversion algorithm.
FossilOrigin-Name: 6632d51f1673e9a6b6e26baebc7aaa1ae27024ad5db1baff6ee5fcf865099f43
2026-02-27 20:37:03 +00:00
stephan
f707e2ec5d Two code comment typo fixes reported in the forum. No code changes.
FossilOrigin-Name: 3fbd28fabc5509a0bf2026cb60891d6d3efe251910baa3a3934225d0a7187bfa
2026-02-27 18:32:12 +00:00
drh
7d9fbe6476 Fix an off-by-one error in the indentation of multi-line outputs in
QRF_STYLE_Line mode.

FossilOrigin-Name: d47499b21c893cc8749a1cafe1cf712dacfeaa6cfe2cdb75d1fc450f3cb6879f
2026-02-27 13:25:42 +00:00
drh
c67a538168 Add an assert() to sqlite3RegisterLikeFunctions() to hopefully prevent
future false-positive bug reports coming out of CodeQL.

FossilOrigin-Name: 7c5f4dcd748baa60097bbf68d7aca99cc959bb1f7da92bd9ad86a4425a37d391
2026-02-27 11:36:43 +00:00
stephan
57d7a20ce7 Another nano-optimization in kvvfs v2.
FossilOrigin-Name: a9d60190d693504742a894918f145111908d7d6cb9e853ba7a2356529046372a
2026-02-27 06:33:28 +00:00
stephan
d22d0edc48 JS: slight performance improvements in KVVfsStorage.
FossilOrigin-Name: 56edf2addb155dbb60269fe563ecb5f6132672c6c61f6f9d18ebdff72111298d
2026-02-27 03:21:47 +00:00
drh
5dfccfb0bb Fix typos in the SQLITE_PREPARE_FROM_DDL documentation.
FossilOrigin-Name: 9174e7dacf867c1f80e73ccf5e0ee7b9e84fbe9f2e53559d06b72206b1cde3c6
2026-02-26 16:19:21 +00:00
drh
5a6eef2fb2 Improvements to the SQLITE_PREPARE_FROM_DDL documentation.
FossilOrigin-Name: c3288f16848866a2c846221c33631785f7b39938078bb95c61895f789395aa1d
2026-02-26 13:35:38 +00:00
drh
8bc78bebfb Fix an inconsequential typo in the output of the datedebug() SQL function.
FossilOrigin-Name: 3a92a53d8cf77822c22618dbf35851a20d27c4a659d23db2d24e7ccb3f61c7fc
2026-02-26 12:17:19 +00:00
dan
a86c6017e7 Fix a problem where the wrong collation could be used as part of a row-value comparison between columns with different collation sequences. [forum:/forumpost/6ceca07fc3 | Forum post 6ceca07fc3].
FossilOrigin-Name: 212c68249cc0e8904fc36d8e90646d04604f2b3b9d4c32eaeac7d920fa0fba99
2026-02-26 11:03:22 +00:00
drh
1a152ea92a The GCC bug is fixed in GCC-15.
FossilOrigin-Name: 21f9abe6c9d1e2ce99ed75c2984103dcd2356b5d53bca3f3732176bb856bf3f7
2026-02-25 21:19:20 +00:00
drh
f45c695471 Reinstant the work-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC compiler bug 96270]
which is apparently still an issue as of gcc 13.3.0 with -m32 on Mint Linux.
The test case in the bug report is fixed, but the vdbeMemRenderNum() routine
in SQLite still shows the problem.

FossilOrigin-Name: 7fae321095ebec775de1b39b974fb1f295d5efbd5723e9cb29a981c97a4262c8
2026-02-25 12:44:19 +00:00
drh
46bf39e396 Use a 64-bit hash for the testing option SQLITE_CHECK_PAGES to maintain
page alignment.

FossilOrigin-Name: 75a35cd8f97f8a6cd2311c829685bd3b1cfb394de15174aef347f15cfb1913a1
2026-02-25 01:04:22 +00:00
drh
b1a73ba34d Adjust the changes to shell8.test from [5da9bf09cc00faf9] so that they
work with older versions of TCL.

FossilOrigin-Name: c3b9e2cee3565da50bcc92766f700c31142391a697cbab7465774cf20a307dd8
2026-02-24 19:50:27 +00:00
drh
9d65290207 Rename SQLITE_ENABLE_MULTITHREADED_CHECKS to SQLITE_THREAD_MISUSE_WARNINGS.
Run test cases with that option. Also add the
SQLITE_THREAD_MISUSE_ABORT option.

FossilOrigin-Name: be8c8b9cb7b618a1571a988bc1cfdc15d99a8bf144d699385c0076e940b9f7f5
2026-02-24 19:37:16 +00:00
drh
da67225f04 Fix an assert() that is incorrect when the SQLITE_DBCONFIG_FP_DIGITS setting
is on a non-default value.

FossilOrigin-Name: 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4e29f95764fe1027d4d8706a41480
2026-02-23 19:51:54 +00:00
drh
d2e27e5d54 Add test cases for the symlink defenses of the previous check-in.
FossilOrigin-Name: 5da9bf09cc00faf98cc515fb5a10a0af325b8f7608893808d031dfef62380be2
2026-02-23 13:29:29 +00:00
drh
ffd9892a02 Change the SQLAR archive extraction algorithm in the CLI so that it
uses the newly enhanced realpath() SQL function to guard against
attacks that use symlinks to try to write files outside of the
destination directory.
[forum:/forumpost/641b09daa17d9086|Forum post 641b09daa17d9086].

FossilOrigin-Name: 7cced53e8c508fbf1816162c5358c77a712f76a38fd18f07171efc3c028a3c57
2026-02-23 12:19:05 +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
9dac613f04 When doing an SQLAR archive extraction in the CLI, postpone creating symlinks until after
all files and directories have been created.  This prevents a hostile archive from
creating a symlink through which it can subsequently write content outside of the target
directory.  [forum:forumpost/9e176adfef91c207|Forum post 9e176adfef91c207].

FossilOrigin-Name: 9719034d4d3becda127dc294f7f58ded9c982509c690dd55b56310912957eb51
2026-02-23 01:34:14 +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
60f132bf12 Fix typos and include wording in the documentation for
SQLITE_DBCONFIG_FP_DIGITS.

FossilOrigin-Name: c30cee1224904eb2092daa0ad9494aec7c7a8c6c1661f5b91b62c3ef0c5ea95b
2026-02-21 21:19:41 +00:00
drh
f8681fb638 Fix a harmless warning in the decimal extension.
FossilOrigin-Name: f16c7c4000f2b992f7245dcaf669f13ed464579f8894f3c16842eebf41285c70
2026-02-21 20:20:06 +00:00
drh
283f33233b Improved rounding of double→text conversions for rounding digits
of 17.  Add the new sqlite3_db_config(), SQLITE_DBCONFIG_FP_DIGITS,
to specify the number of significant digits to preserve on conversions.

FossilOrigin-Name: 78c12b4f6ae869c3ea5e368c97b45991442bdd2d3a60935f1e6fc02a8e01cd41
2026-02-21 20:03:47 +00:00
drh
8642ca2025 New sqlite3_db_config(SQLITE_DBCONFIG_FP_DIGITS) that let's the application
specify the number of significant digits that double→text conversions
will attempt to preserve.

FossilOrigin-Name: 3f16985dcc47a366b54164c5024f920a79dddd76faeac5e36b4770732ed72c0a
2026-02-21 19:26:58 +00:00
drh
699959ff25 New test cases for floating-point conversions.
FossilOrigin-Name: 3033fe97b14ba0531278d4aa444bc5340e044b87a72b3a4341032ddee442000f
2026-02-21 13:57:40 +00:00
drh
7aba858597 Remove an unreachable branch.
FossilOrigin-Name: 93f90eacc0c5b2ae0042ec525359298883f8473e24967208feef4029d9fa2d08
2026-02-21 13:40:07 +00:00
drh
4428aa842c Increase the precision of double → text conversions that happen in
sqlite3_column_text(), or sqlite3_value_text(), or in the CAST() operator,
or similar, so that round-tripping the value back to double results in
exactly the same value.

FossilOrigin-Name: ef0049e3ade304f64e1ab97e52e1e21379e4db461f3fa80dac8e544fb90d622f
2026-02-21 10:57:02 +00:00
drh
24ef9fbb19 Further simplification, performance gain, and size reduction in
sqlite3FpDecode().

FossilOrigin-Name: 5954f22ceb6b43ed160ec085cd86b66299d8aab3e349a41941a4f1c2eade7457
2026-02-21 00:56:11 +00:00
drh
aec283385e Small performance increase and size reduction in sqlite3FpDecode() by using
local variables instead of structure elements.

FossilOrigin-Name: b4c378bba582205aa676e45b21ffa17ad6199e2a017ec73cf41a0243f693b589
2026-02-21 00:20:29 +00:00
drh
ac5ee556eb Inconsequential changes to floating-point conversion, amounting to mere
code cleanup to aid comprehension.

FossilOrigin-Name: 6d9c29123b6b143b0f7c8f5d018f170c72edfc5b1a4d67edd45e5552def2af6c
2026-02-20 20:43:25 +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
stephan
9e395efec6 Fix a cse in the fiddle.debug build where it could not overwrite its read-only/generated index.html.
FossilOrigin-Name: 7adb2c0f438a97d377760436b1ac81fffab36e541a2b5ee733bfc7108e0180e5
2026-02-20 14:22:09 +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
20c65785cd Improved rounding of floating-point conversions in some corner cases.
FossilOrigin-Name: 436dccd42650a6ab0a74459ae42fdb3e36d853f934324acc2bc961f87c001852
2026-02-20 12:27:52 +00:00
drh
e8750019c2 In the CLI, the ".quit" command in a --cmd argument causes an immediate
exit.  [forum:/forumpost/f057122b68|Forum post f057122b68].

FossilOrigin-Name: 4731cc8856aa4dcfad5db501648bfd0afef43d8c5f339e7b11a1e3ee64348b87
2026-02-19 17:20:40 +00:00
drh
cac09127e1 Improvements to rounding behavior in the new floating-point conversion logic.
FossilOrigin-Name: e540f6c370675ae043af8cdbb80f7eb17c08e50f7634e0b78f0b1dccf7bd4b18
2026-02-19 12:59:42 +00:00