1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

1647 Commits

Author SHA1 Message Date
drh
a87eb97e08 Initial implementation of the experimental sandbox(N1,E,N2) function.
The function resolves (by transforming the AST) to the expression E if
N1 and N2 are the same constant expression.  Requires the
-DSQLITE_ENABLE_SANDBOX_FUNCTION compile-time option.

FossilOrigin-Name: 035fd52d54a6f8f9c8276a48f466d660832d46d05a02b3ee4a41959922a4bc22
2026-10-14 20:06:21 +00:00
drh
265bd6339f The code for sqlite3_analyzer is still in the tree, and you can still build
it using "make sqlite3_analyzer" but it does not get built as part of
"make tool-zip" and there is no mention of it in the README files and
similar.

FossilOrigin-Name: 77278079d9dddaff30a1862bf412329e91242a41be7eafc19d3fac8d872adeff
2026-10-09 23:18:07 +00:00
dan
fdc06f3643 Fix a build script problem causing generated file sqlite3-all.c to #include "sqlite-10.c" instead of "sqlite-A.c".
FossilOrigin-Name: 962b207123fe2bd6d72ad49fb80822b4e4290c1d77ea4ca097ea341202d4cc5f
2026-10-09 11:22:17 +00:00
drh
f19a90c569 Improvements to the display of DDL SQL statements in the CLI and in
the sqldiff command-line tool in order to close comments and similar
in the case of a corrupt schema, and avoid possible SQL injection
attacks.  ANT-2026-9VFH4DZS.

FossilOrigin-Name: 028a92f9c353d3b400551954de2e09c1723076491f79ff767dd24b452654fda8
2026-10-08 18:34:12 +00:00
drh
82fda1d99a Sanitize "*/" in tables names of the output of the .diskused command
in the CLI, and in sqlite3_analyzer, so that it doesn't prematurely
close the comment. ANT-2026-XQM1QD48

FossilOrigin-Name: bcde8f991a86aed6280c1b6164bc14cc1aff1a966a694a5fb32341ffa0202960
2026-10-08 10:55:33 +00:00
drh
b0db2db988 Improved escaping of filenames with unusual characters sent over the SSH
link by the sqlite3_rsync utility program.  ANT-2026-31X9HVRR.

FossilOrigin-Name: eaec2f7f3744d4cdf0cdafce22e1909208f93734bf55263a042938919bd81310
2026-10-07 23:07:55 +00:00
drh
1ffe6567e8 Include a work-around of the Microsoft "WorstFit" bug on Windows builds
of the sqlite3_rsync utility program.  ANT-2026-H5TXKR5J.

FossilOrigin-Name: 2662a68f0d5ce1c8ffd6e8ec3e79b27f7cb5e6142a007a6641e1ac0b5a22037a
2026-10-07 17:05:09 +00:00
drh
f0c7055db7 Omit the -r command-line option from Lemon. That does not affect
SQLite. [forum:/info/2026-10-05T15:11:11Z|Forum 2026-10-05T15:11:11Z].

FossilOrigin-Name: bc72b1d95c2f098a92013ad9f4ab60440c105cd17889d12ae7349a4531a90c75
2026-10-05 15:20:48 +00:00
drh
cb547ab3e9 Update the CLI and the sqldiff utility program to use "COLLATE nocase" when
comparing table names in sqlite_schema.  Add the --unsafe flag to sqldiff
so that it can attempt to process corrupt database files.
Changes inspired by ANT-2026-YKVW6RS4.

FossilOrigin-Name: 65ec11f05a9ee5b23495427ece76c0550a8ffc28980a8a0c72d556ba0d2290e2
2026-10-02 20:18:07 +00:00
drh
ac5f698ccb Fix the "sqldiff" utility so that when using the --primarykey option on
a table that has a PRIMARY KEY with redundant columns, it does not overflow
the array of PRIMARY KEY column names.  Bug discovered by Anthropic as
ANT-2026-Y36XS4M7.

FossilOrigin-Name: 8ffd0be079e4f04d686b9842ff282bb816b422a9301bb162e0437d40f0b9f065
2026-10-02 18:47:27 +00:00
dan
6842d54eb2 Avoid potential buffer overwrite in debugging tool showwal when dealing with a wal file containing records with a very large number of fields.
FossilOrigin-Name: bc7641d1f190e0dc76589a3b61d85968eb33fd7832a7b2838e38edae7e615b03
2026-09-24 16:32:09 +00:00
drh
943e6b1ed1 When constructing sqlite3.h from sqlite.h.in using the -useapicall option,
make sure to tag all callback arguments with SQLITE_CALLBACK.  Also omit
the SQLITE_CALLBACK macro in comments.

FossilOrigin-Name: 5f8621d2f64344f4f0111f1d64cca5a71731cb037bfeea6e2e6f0368166085d1
2026-09-18 16:30:04 +00:00
drh
cd4e52fe73 Improved support for stdcall on 32-bit windows, for legacy.
FossilOrigin-Name: e638307a519c929271682b9d9093e6dbdc90ca9a07d45ca9fc9ee114d6fd02c7
2026-09-18 15:38:29 +00:00
stephan
be3dc6699e Cygwin portability patches sent off-list from from Jan Nijtmans.
FossilOrigin-Name: f8306cd54d28ceda631ce9053d94df2bb28cffccce2a7e72d088b4b1f2a0d3ed
2026-09-01 16:26:50 +00:00
drh
638e0b1a03 In Lemon, remove the option to omit compression of the action table.
FossilOrigin-Name: 9b75f0c3466a551ff24a21a4caac3e0b6b92768e025c603560929e374acf5ef3
2026-08-31 09:48:26 +00:00
drh
b130fc5319 Enhance the tmstmpvfs.c extension so that it tags zero pages in the log file.
FossilOrigin-Name: e9d649b77b14990cdc5440e08fdace6989737f3fd1acfc8b1c1bb72be7022ec0
2026-08-26 12:31:34 +00:00
stephan
6bea9c26bb Remove a harmless unused variadic argument in sqlite3_rsync. Bug report [bugs:bc49306e10e92b10|2026-08-24T01:22:51Z].
FossilOrigin-Name: 5231ac428da4486d64e473e98aa72da5ca68848fba97845dbcf51fd2314debbf
2026-08-24 09:56:51 +00:00
drh
8d0cc5e4c6 Fix a faulty assert() in lemon, as reported at
[forum:/info/2026-08-20T14:18:08Z|Forum post 2026-08-20T14:18:08Z].

FossilOrigin-Name: 0672f6f07483b570eb9b3d27ca50a3f8564d2adad18fa7703240d45bbbd098b2
2026-08-20 16:47:20 +00:00
drh
9b438bee82 In Lemon, do not invoke qsort() with a NULL array pointer even if the
number of elements is zero.  That is harmless in practice, but is
technically undefined behavior.  This change does not affect SQLite.
[bugs:/info/2026-08-19T05:56:54Z|Bug 2026-08-19T05:56:54Z].

FossilOrigin-Name: fc3c471a7e494a014364d68be5471223c8e4ebc99eed7468dcccab095a22787a
2026-08-19 11:15:38 +00:00
stephan
14385e5a25 Build portability improvements for buildtclext.tcl, from [bugs:2026-08-13T19:40:39Z|bug forum post 2026-08-13T19:40:39Z].
FossilOrigin-Name: 2530b5ada6e814931db257d3b5ca756032f2c004a2d96cb2d998619e79ce0958
2026-08-14 15:17:24 +00:00
drh
a9a1fac180 New compile-time option SQLITE_MAX_SCHEMA and runtime limit option
SQLITE_LIMIT_SCHEMA that put an upper bound on the number of objects
in a database schema.  Current default is 10 million.

FossilOrigin-Name: 4ff362a4c2897e2b438d3d8fc88a012264526fa617f058be5a2d596c42d2e8a4
2026-07-10 15:06:05 +00:00
drh
d58cea22b2 In the sqlite3_rsync utility program, fix three defects identified by
[bugs:/info/e2dfadf51209f12b|Bug e2dfadf51209f12b].

FossilOrigin-Name: 805f3acd2b0e81c8274680cbc4cdd6b7b9246df8075ed9caba9e2780729a2740
2026-07-09 16:34:26 +00:00
drh
76ad3be617 Add the --raw option to the dbtotxt command-line tool, for debugging.
FossilOrigin-Name: abfecc08209c9377b6762125b2372e4eb1ab56b4d0399467c8fbe5cfc11c806e
2026-06-12 11:55:39 +00:00
drh
84ead09d94 Harden code that processes Fossil Deltas against OOM and maliciously
malformed delta blobs.
[bugs:/info/2026-06-10T07:01:00Z|Bug 2026-06-10T07:01:00Z] and
[bugs:/info/2026-06-10T07:06:43Z|Bug 2026-06-10T07:06:43Z].

FossilOrigin-Name: 67271c31292bc1bddbb5e144c881c85c9f91b3963a1db4bae1f738adab50f7c0
2026-06-10 09:51:33 +00:00
drh
ce2f503c1c Strength the defense against malicious command-line arguments in the
sqlite3_rsync utility program.

FossilOrigin-Name: c84d596b6da22061627282d444913c88dc2f9bd82e86957183f7e732f2713b33
2026-05-26 11:23:00 +00:00
drh
077be44cc2 In the Windows OS interface, use CreateFileMappingFromApp() and
MapViewOfFilFromApp() if SQLITE_OS_WINRT is defined.

FossilOrigin-Name: 3c51436b43ab77b88134851a2773147b49a3c4fb5b0416db5e318b6e12d3b708
2026-05-13 15:11:04 +00:00
drh
1f9c2ed674 On Windows, use only GetSystemTimeAsFileTime() and not GetSystemTime().
Also add a TCL script that will renumber the systemcall thunk for Windows.

FossilOrigin-Name: 4b7f0130d68c7a0b98e87d09d0a661c85554215cb111478305307960deab3921
2026-05-13 13:55:31 +00:00
drh
6b4eb6725f Improved detection of when the alternative windows-compatible main() is
needed in the sqldiff.exe utility.

FossilOrigin-Name: e25b849a603cb08ab888641ff324e9aa129391c4792de86a62c55e9caf84c16e
2026-04-27 14:01:23 +00:00
stephan
f0baddb205 On platforms which support ./configure --with-icu-config, ensure that 'make tclextension' includes the ICU pieces in the tcl extension. Intended to resolve [forum:92a88de4b88929fe|forum post 92a88de4b88929fe].
FossilOrigin-Name: 404fde8bacc3f05254a2fcdb1531a7f53125a7ad45dc6b68a5065c1d0c73b670
2026-04-15 11:40:13 +00:00
stephan
afef1f2923 Minor doc typo fixes contributed by BrickViking.
FossilOrigin-Name: c4660ce205919ce0d9262e7fd7879375a72ef65d9e5ac97f19caf5dc36e355aa
2026-04-14 23:53:38 +00:00
stephan
008395614a Tweak 'make tclextension' to pass on any --with-icu-config build flags so that it can link with the various ICU libs. This works for me but needs testing on a wider selection of systems before being moved to trunk. Intended to resolve [forum:92a88de4b88929fe|forum post 92a88de4b88929fe].
FossilOrigin-Name: a8c022d7946e8a29114400c1321f36f03979a2277253f1dcd769d8f36e944ece
2026-04-14 00:11:23 +00:00
stephan
772ea2f01c Add SQLITE_STRICT_SUBTYPE to PRAGMA compile_options, an omission reported in [forum:3906a71526|forum post 3906a71526].
FossilOrigin-Name: c5af6a10245b6b847d30002806c1577b020c36ab27f7b1cf202ade136aa4779c
2026-03-26 19:11:57 +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
b50ce08591 Include the float-point table generator utility in the tools directory.
FossilOrigin-Name: 4ab10b251d870af8297b9e505452393f6000f83784c822ff128e7aec06f8c72f
2026-03-17 09:45:47 +00:00
drh
7fa89ea907 Change some sqlite3_realloc() calls into sqlite3_realloc64().
FossilOrigin-Name: a391f5646926787fd9a004225ea406b61d20f282c852c0282fd26cada644b601
2026-03-02 15:06:59 +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
c652e34317 Correction to date/time computations associated with the timestamp-vfs.
FossilOrigin-Name: b67889e4f17c3280f839ee7045256cc47d6ce3ed60d880925e3d30f9ebbcf3ff
2026-02-10 19:33:11 +00:00
stephan
bfb33d476b Capture sqlite3_rsync's remote-end result code so the local side can exit with non-0 if, e.g., the remote sqlite3_rsync binary is found but fails to start. [forum:43eb1cd1c3979817|Confirmation received] that it resolves the motivating problem report.
FossilOrigin-Name: 971d51374e3bf0d0e0b106750dc1e499d1fdbd3233cf8264a534138b27f8d0a1
2026-01-28 17:25:18 +00:00
stephan
f5d29d6424 Teach sqlite3_rsync to increment its error count when a child process fails, based on [forum:8fe404e547faa42e|forum post 8fe404e547faa42e]. This passes basic sanity tests but requires more testing and needs a review of the final 'else' block in the new code.
FossilOrigin-Name: 8be55d405f4ce424760150a2b59b5f663041fdcb377d1b9893b4f4e8e1940246
2026-01-27 16:15:22 +00:00
drh
a943c0e973 Add the --csv option to the showtmlog utility program.
FossilOrigin-Name: 2e96e8efa9a331b0f7d928c55e7d85be64e7c60c85032c1e972f77fe790bdec4
2026-01-27 14:27:19 +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
cd8aee7946 Change the copyright on the tool/dbtotxt.c source code file to the
standard SQLite blessing.

FossilOrigin-Name: 766c89e009578aa5c1a92cbb2dcc34b3529cf4dd6157f07c84f08470d81942a9
2026-01-16 12:13: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
c219d3002f In the showdb utility, the -tmstmp option works without -csv for the pgidx
command.

FossilOrigin-Name: c0aecd2189b431d82eca1c1d6718920cf928d910d443ea506e7b3bf3c5d7e246
2026-01-08 13:20:36 +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
e46b51e234 Improve showdb so that it does a better job of handling reserve-bytes.
Add the --tmstmp option that causes pgidx to interpret tmstmpvfs tags
if they are available.

FossilOrigin-Name: d7e6e9a5781f467a5b5f02f46134099cf01607a0cf55510155533d57d4a4618a
2026-01-08 01:37:13 +00:00
drh
ad4b08dcab Add the --csv option to the "pgidx" option to the "showdb" utility.
FossilOrigin-Name: b6ad93f62eb883ee8f4c43dd90c69b31398be6b13186866a7b05d85fe588d967
2026-01-07 23:46:44 +00:00
drh
242a9347f8 Add the -p or --port option to sqlite3_rsync.
FossilOrigin-Name: 53f806fdab7161e439a165af47bd45332c15233b87bc35c2272621256a2dc337
2026-01-06 21:39:12 +00:00
stephan
b1e9111249 Fix an uninitialized var use reported in [forum:88561a4a1e|forum post 88561a4a1e].
FossilOrigin-Name: 707c0f6442e946f23de061ee2753eb5994ab55d411c49b232799f309ba0f10cf
2026-01-04 11:05:05 +00:00
drh
9f44bc5ea0 Add missing free() to winmain.c
FossilOrigin-Name: 44dff1a1bb986cd08b729d4b73f09c995cbc67f884caa297674b31fb36805c8b
2025-12-30 13:01:05 +00:00