1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-21 11:13:54 +03:00
Commit Graph

782 Commits

Author SHA1 Message Date
drh
cdaff852bf Were we to choose to integrate the carray() table-valued function into the
amalgamation, that integration might look something like this.

FossilOrigin-Name: 2b43d5d7dcc5aee14a050c824a5e09b6a38a9c78ddcc25a994eba5d4c5ad9ba2
2025-10-08 15:32:55 +00:00
dan
6147a0f6a1 Add test cases for the carray module.
FossilOrigin-Name: dcfc0164a95eddb5e924c606850fe2015e8f2f516d36b380cbb79d6bdfe034fc
2025-10-07 21:02:37 +00:00
dan
9b6bc61dbd Fix some integer overflow warnings in the base64 and base85 extensions.
FossilOrigin-Name: 06b4bd2aba22c57f5a5fed606c3bee225dee6fdc13bb16cc58194040ef0d7d85
2025-10-07 15:14:03 +00:00
drh
1d574d3d71 Remove the memvfs.c extension, to prevent it from being misused.
See [forum:/forumpost/91811439aa|forum post 91811439aa] for the complaint
that prompted me to take down this demonstration code.  I have other things
to do rather than argue about posts such as the foregoing, so it is easier
to just take the code down.  If you need this code, you can downloading older
check-ins.  The beauty of DAG-based version control systems like Fossil
(and Git) is that nothing is ever lost; it is just stops appearing on
trunk.

FossilOrigin-Name: eb79110dcac80dde3bcca0929d67a8f8f6d2eea5695184b2b7c6788283f06902
2025-10-02 22:48:08 +00:00
drh
e2ebc364cd Fix typo in the previous check-in. Remove surplus end-of-line whitespace
from the ext/misc/fossildelta.c extension.

FossilOrigin-Name: cc87551805dc1fcb05598339e526b304401b64a4eaaa2148a9d837b1423484ce
2025-10-02 19:35:58 +00:00
drh
0d9ec8b2ee Harden the debugging vtab "delta_parse()" which is part of the
ext/misc/fossildelta.c extension against malicious inputs.
[forum:/forumpost/be139437c3|forum post be139437c3].

FossilOrigin-Name: 4be6deee646f2c0f591ba81f902182ca9302050a7fb2729c7f64981307058b8b
2025-10-02 19:19:40 +00:00
dan
cbc3cd47f0 Fix a buffer overrun in the zipfile extension that could occur while processing zip archives with extremely long file-names and comment fields.
FossilOrigin-Name: c284fda848038a61972fd1df5796f608a24ead109170aafe562a5d5787c46488
2025-10-02 11:16:22 +00:00
drh
65ee59bb26 Prevent embedded 0x00 characters in the output strings from confusing
the completion extension and causing it to read past the end of an array.
[forum:/forumpost/88a08b3201|Forum post 88a08b3201].

FossilOrigin-Name: 26f6d41f9d3ab656129af333d54a8645c6890314919bcae90351ba0c2240ceef
2025-10-01 19:01:19 +00:00
dan
a9af4102f1 Fix a buffer overread in demo code in ext/misc/memvfs.c.
FossilOrigin-Name: 90f7318308ca8372cbd9f183d88ff6cb884446f6df0695294c9a9955c5109f72
2025-10-01 14:28:48 +00:00
drh
0f76b0a4d6 Fix various compiler warnings.
FossilOrigin-Name: 24ee6c25b4745c8fd671d845b48b9ab98a787ccb348d560ad70f19d035e7990e
2025-09-30 17:37:18 +00:00
drh
c8e6f627b8 Fix the new generate_series() to correctly deal with an explicit 0 as the step.
FossilOrigin-Name: b059413c440d1b831c9a462f7165a350001ba7a8cc77ca2a0a8f2bb73c830aba
2025-09-30 17:12:39 +00:00
dan
d05bf5aedf Fix another potential buffer overread in the zipfile extension.
FossilOrigin-Name: 0819fe670f9ceec79f84eb09c234dc29f6581332f86a53d6a0547697404efff1
2025-09-30 11:17:40 +00:00
dan
3eccaa7915 Fix a buffer overread in the zipfile extension code.
FossilOrigin-Name: 70c2c99b6f12a3467c23b44adcaf2d7d780ba8317b72de2f6730b1d892cf0c85
2025-09-29 18:55:05 +00:00
drh
1bf80f2dce Minor bug fixes. Many new test cases.
FossilOrigin-Name: 86dcc68d1816d970d8d5fb158696c3fe6c5ddcac2c255823110d656372503885
2025-09-28 17:24:42 +00:00
drh
d3cd2a25b4 All legacy tests are passing. Want to add new test cases before merging.
FossilOrigin-Name: adb80761d2319e16b6db2b5e35fedc239fad0ed5d26d629a5ea659c90881f76a
2025-09-28 11:01:05 +00:00
drh
9ffb344ed9 The generate_series rewrite is working better now, but is still not
completely correct.

FossilOrigin-Name: 6c41d14707e6890ca6d0460c72178ccb710d7f41dead76f222f1382c5cbd5a9a
2025-09-28 10:36:23 +00:00
drh
5b047a8ec6 Refactor the generate_series extension. Compiles but does not yet work.
FossilOrigin-Name: 25e395a82f14513bf23c1e913fe24be77ad74fec1540f524e709f9cdfeb3dc56
2025-09-28 09:25:07 +00:00
drh
54f296389c Rework the bounds calculations on generate_series() in an attempt to
avoid signed integer overflow when the bounds are ridiculous values.

FossilOrigin-Name: 3d9148c7d7379a34a0c2a33a1eb2562234868bc0b14c3d16990b33e52fd4ebc5
2025-09-27 15:03:11 +00:00
drh
15e4074084 Additional cleanup and refinement of the regexp.c extension.
FossilOrigin-Name: 2b34b750b5528b6dda195bc1a3895dc3fe46e70cbf992a78111316e2726c1ade
2025-09-27 11:54:49 +00:00
drh
b62c26d999 Limit the complexity of a REGEXP pattern using SQLITE_LIMIT_LIKE_PATTERN_LENGTH
FossilOrigin-Name: 869c968569b09d05a5b7d587d8fddb3b4611daf7467dc157701e5dc6c9608606
2025-09-26 15:38:52 +00:00
drh
80d74f0934 In the regexp extension, limit the maximum value of integers in the
"{p,q}" syntax, as performance of the NFA used to do pattern matching
is linear in the maximum such integer.  The limit is SQLITE_MAX_REGEXP_REPEAT
which defaults to 999.  This helps to prevent DoS attacks in systems that
make use of the regexp extension.

FossilOrigin-Name: 911c745f88c0ee8569e67bbcbbab034264f8c981b505aadac3ce7289486a1a68
2025-09-26 13:14:20 +00:00
drh
8d2f3a1f82 Fix harmless integer overflows caused by over-sized integer constants in
the "{m,n}" syntax of the regexp extension.

FossilOrigin-Name: 8f17e1d869685b51f3368feed03dc06543ec16bc8fd81b8daad2ac2dbf99c5d6
2025-09-26 11:53:54 +00:00
drh
dc868ef879 Convert the ShellText object in the CLI to use sqlite3_malloc64() rather than
plain malloc().  Avoid unnecessary quoting of table names in .dump output
and similar.  Improved detection of OOM in set_table_name().

FossilOrigin-Name: 6ce4f6dc15a575c318669051fe6590ad114b52ff3f3e260cdf7accccdd922d63
2025-09-25 10:55:54 +00:00
drh
96bb92e70c Special case the "decimal(-0.0)" output to show exactly 0.0, just as it
does for positive zero. 
[forum:/forumpost/adc719d88d56ab22|Forum post adc719d88].

FossilOrigin-Name: 9ca4163bd93d78be5e4daf2b5d2b920d54d038c6fa8217dd2add0be0da6cd6b0
2025-09-24 17:49:09 +00:00
drh
68353d0531 Fix a harmless compiler warning in IEEE754.
FossilOrigin-Name: 7f72308322cd1f238e6c725ec6bff44ed42fb2619f3f52afe38e2faad838a63f
2025-09-24 17:38:13 +00:00
drh
feeacfb897 Fix incorrect buffer size computation for the base64() extension function.
[forum:/forumpost/b1993c858f|Forum post b1993c858f].

FossilOrigin-Name: 603efcd404f0013559ca5bd936fc39481a3aa33a10340bac27b751b6b286d0b7
2025-09-24 12:01:50 +00:00
drh
b927708437 Restrict the size of the LIMIT on a generate_series() query to avoid
an integer overflow when computing the final output value.
[forum:/forumpost/479bfb0d3b|Forum post 479bfb0d3b].

FossilOrigin-Name: 266aacb4759945f7cf7a258014620f21225261246edc08e6e71ff5292baf22f3
2025-09-24 11:12:26 +00:00
drh
611ffbc981 In the ieee754 extension, render -0.0 as 'ieee754(-1,-3071)' instead of
'ieee754(1,-3071)' as that makes the sign clearer.  Both strings still
convert back to -0.0.  Note that negative zero
and positive zero are distinct values in ieee754.
[forum:/forumpost/1eab7e4a08|Forum post 1eab7e4a08].

FossilOrigin-Name: 136188c161a8a2d5166798fcbd341bd1d3f81da7291011f806d6b2153544832c
2025-09-23 16:01:45 +00:00
drh
65a445d750 Fix the decimal_cmp() extension function to give correct results in
corner cases such as negative zero and two equivalent values where one
has extra trailing zeros to the right of the decimal point.
[forum:/forumpost/367c770224|Forum post 367c770224].

FossilOrigin-Name: 25b3626a018fa5916d0e129ee057c3f709c6e4d0b84a1a3102cad127a39a3db9
2025-09-20 14:32:12 +00:00
drh
8f5503861f Try to make the carray extension easier to compile on VxWorks.
FossilOrigin-Name: 1a34c3f49ec48b551098f6781a3a6355aa3c9fd47fd9ebaef01f254b1dcafc9d
2025-09-18 19:59:56 +00:00
drh
065daf24b4 Minor #ifdef changes to the carray.c extension so that the source file can
be more easily imported into a larger program (such as TH3).

FossilOrigin-Name: f16fd1afbb65f88d7b94c2488ddd59549d71894ab5fcee46b4c55bfe646bfc9d
2025-09-10 20:28:57 +00:00
dan
2af776ff59 Fix a typo in a comment in carray.h.
FossilOrigin-Name: a4e137de0e82fbba890c2a608578f02f3666d2c25fb76f95ddf2d6a096a30e6c
2025-09-03 21:19:11 +00:00
dan
0e77c3fa4d In cksumvfs, do not write checksums to the wal file, as this prevents recovery from working.
FossilOrigin-Name: 5bf48c7e31904f1f7048499c630801846df89f262b32ea1e49fb6e039eaad11a
2025-08-13 18:37:41 +00:00
dan
c5c9c6093b Fix a problem with the checksum-vfs and direct-overflow-reads.
FossilOrigin-Name: 8288edb9f930206f117823cf1d18af632dc6adbd7c4c3b9bcfc252e1a5e5b9cd
2025-08-13 14:35:14 +00:00
drh
332eb8e63c Add bounds checking and error messages and improved comments
to the (unused) zorder extension function.
[forum:/forumpost/e3f1ede174|Forum post e3f1ede174]

FossilOrigin-Name: 6bb717acf706e6ffd4671660ca78237e6a42863f344518e6d21065bf735f971e
2025-08-05 10:54:56 +00:00
drh
f9c2cff2fe Improved defenses against corrupt ZIP archives in the zipfile extension.
FossilOrigin-Name: 642e89191deaf75db236102248c662aeef65bcd3dcbdfea694256583556be75f
2025-08-05 01:53:03 +00:00
drh
69b5674b40 Additional header comment documentation in the ext/misc/vtablog.c test extension.
FossilOrigin-Name: 3656acfaa3011321a6e17fb81e5bdedcfffeab6035f133ab89ae9589bf5bef72
2025-07-11 17:02:11 +00:00
drh
a24a397b8b Improvements to sqlite3_vtab_rhs_value() logging in the
ext/misc/vtablog.c extension.

FossilOrigin-Name: 25131ee84f53dab1191e02c19cefd256aed2828c7edea325fcc0ba3b0a668583
2025-07-03 15:50:18 +00:00
drh
1ff6f19d8b Enhancements to the xBestIndex output from the ext/misc/vtablog.c
extension.

FossilOrigin-Name: 8b31acc0b18f38eb4af6efebd1ea25cd65a146651101579aee20afd9ec6dc2de
2025-07-03 14:10:03 +00:00
drh
59de42763f Fix an out-of-order local variable declaration in ext/misc/fileio.c.
FossilOrigin-Name: a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d
2025-06-19 20:19:12 +00:00
drh
f091f423ad Adjustments to ext/misc/fileio.c in an attempt to get it to build using mingw.
FossilOrigin-Name: 96b14a3f1193de8f30e9fa704f87558dab8027a218868d32e47688cd5df497b7
2025-06-09 22:38:34 +00:00
drh
b1929b7117 Remove the clunky test_windirent.h and test_windirent.c files from src/
and replace them with a much cleaner and more compact ext/misc/windirent.h.

FossilOrigin-Name: acc978df52ec41ffdb5c27764f30d53efa1f25a314b7d98983dc0d211a36b570
2025-06-05 20:12:41 +00:00
drh
6facd9566d Enhance the FSDIR virtual table with a new "level" column. The query planner
knows how to optimize to avoid search deeper than the maximum requested level.

FossilOrigin-Name: 1ddc0f9e79c33957961bc1443ccb74d756a02cbd20850052079782e76aef2706
2025-06-05 18:28:54 +00:00
stephan
c5031b578b vtablog.c doc fixes reported in [forum:416d1e37b2|forum post 416d1e37b2].
FossilOrigin-Name: 5d25f62bcd2d754134f608162778b49b0e71c29bd5a6f2461a07caca3d76c7de
2025-05-24 16:01:50 +00:00
drh
494830ca8e First cut at enhancing the fsdir virtual table so that it works with
unicode characters on Windows.

FossilOrigin-Name: c9e04dadfdf6c860631ce5603693add565ff2033aa25af5736302af7045fc91e
2025-05-13 16:58:36 +00:00
drh
a0b34dcfc0 Fix a coding mistake in vfstrace.
FossilOrigin-Name: f0054cc0bce4ed735796da1ea68b7773a582042bdd60fdae4e1af4c592104d15
2025-05-12 11:48:39 +00:00
drh
8a6f89c845 Remove unnecessary "www." prefixes on domain names in URLs.
FossilOrigin-Name: 20acd630b91609725794ce84f9eda01d5f3c898407f0948264830851d25ccaa6
2025-04-10 10:18:07 +00:00
drh
69da86bf93 Fix harmless compiler warnings in the memstat.c extension. No changes to
the core.

FossilOrigin-Name: 9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486
2025-04-02 12:41:16 +00:00
drh
75484481c7 Fix the generate_series() enhancement from check-in [d50b784807333c54]
so that it works even if the number that "value" is being compared against
is a non-integer floating point number.  Bug reported by
[forum:/forumpost/0d5d63257e3ff4f6|forum post 0d5d63257].

FossilOrigin-Name: c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13
2025-03-22 22:55:33 +00:00
drh
8db881d055 Change the generate_series() table-valued function so that its rowid is just an
alias for its value.  This allows it to be used as the RHS operand of a
RIGHT JOIN.  This fixes the issue raised by
[forum:/forumpost/1e17219c88|forum post 1e17219c88].

FossilOrigin-Name: 77db4d85e70fbf358ae2321c2601966666bdb4d971d7c113ce30a3e541458ee8
2025-03-18 20:15:16 +00:00