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

32669 Commits

Author SHA1 Message Date
drh
7c90f02767 Corrections to the mode matrix in the CLI
FossilOrigin-Name: 0bca30616566d196d3cb4da1684feaf54bb38e304f4393ace322fc48c0a2f540
2026-07-07 13:24:23 +00:00
drh
cdbb701776 Fix a problem with --rowcount found by Claude in code review.
FossilOrigin-Name: bc5fb05aa6e8c819cb2c45ea96538b82b5b9c21058ddf685e84d50b183656578
2026-07-07 13:16:30 +00:00
drh
9c202c32c1 Improved title separator in QRF when using "-title always" on an empty row.
Improved comments on the mode matrix in the CLI code.  Additional test
cases.

FossilOrigin-Name: a102d28fca6376da670b274d3d733da2c73da9abe3e7128defd04b4015b03a48
2026-07-07 12:24:50 +00:00
drh
dc4cb53863 Show --rowcount for "--style insert". New test cases.
FossilOrigin-Name: 386c40e3a9706111542b7f336e82f7bb6e9f43c6056185f9f3bd9aae1159070a
2026-07-07 11:00:10 +00:00
drh
0fe9987880 Continuing work on --rowcount and --title always.
FossilOrigin-Name: adeb4fbb86a8a781d7efb0eecb9c84ce605d0bd45f63992bf2ecd60765a60d2c
2026-07-07 00:23:38 +00:00
drh
8e409df984 Add new option "bRowCount" to QRF. Add QRF_Always as a possibility for
bTitles.  Use these feature to enhance ".mode psql" to be a better
approximation of what psql actually does.

FossilOrigin-Name: 600c6b464050078b38cc688668148f684243e7c5f08d0aae4d5f72aa6f985482
2026-07-06 19:24:15 +00:00
drh
1b2a4a37b0 Reduce divergence between ext/misc/fossildelta.c,
the delta code in ext/rbu/sqlite3rbu.c, and Fossil itself.

FossilOrigin-Name: 7f49a7a90eda01753c0dff65197bd7bc48a751e24a46919d30af6e2baf0788fc
2026-07-06 16:26:30 +00:00
dan
2f7c4bbc19 Fix an OOB read caused by passing an out-of-range phrase number to fts5 auxiliary API xPhraseFirstColumn() in detail=columns mode.
FossilOrigin-Name: aeb85fdfca0a546cfd3ef26efd58b9ffc8d5fda15562558d8479dee55321596f
2026-07-06 16:04:51 +00:00
dan
f05795b96d Fix a problem in the fossil-delta implementation within RBU causing it to reject some well-formed delta records. Bug [bugs:/info/2026-07-06T13:01:22Z | 2026-07-06T13:01:22Z].
FossilOrigin-Name: 0bfba3824f3d4c136db8479c97bd789fa0df7c86ba95bd0f011c569004be2166
2026-07-06 15:13:52 +00:00
dan
70ca21fa46 Fix another buffer overread in RBU that could occur when processing an RBU database with corrupt rbu_control fields. Bug [bugs:/info/2026-07-06T13:01:41Z | 2026-07-06T13:01:41Z].
FossilOrigin-Name: 46c2476b1074fb56c54068dcc04cac5a3b9da3a25bc0d3b95c00439e63d6ec43
2026-07-06 14:37:08 +00:00
dan
108288ae7f Fix an OOB read that could occur in RBU when using a state db with corrupt contents. Bug [bugs:/info/2026-07-06T13:02:00Z | 2026-07-06T13:02:00Z].
FossilOrigin-Name: 9e54159f9a839f7fae3dee348fab862dc4bbe36ab866d0b3927f05fd10b1414a
2026-07-06 14:10:43 +00:00
drh
b113e89537 Avoid a (harmless) 1-byte OOB read due to malformed inputs in the
normalize.c extension.
[bugs:/info/2026-07-06T13:02:37Z|Bug 2026-07-06T13:02:37Z]

FossilOrigin-Name: b1d7123bc619e3cb9dffa8dd52ba31cc18329b14557d8f2d9e547b729016548c
2026-07-06 13:43:42 +00:00
dan
711af3d328 Return an error if a patchset is passed to sqlite3rebaser_configure(). This was causing a buffer overread.
FossilOrigin-Name: 887a29a8373bc3a5405df2288840c4918c045560a3a1de5303a4984eb4b40b50
2026-07-06 11:58:21 +00:00
drh
e9551eb2a3 In the strdup.c expension, do not invoke memcpy() with a NULL pointer
even if the count is zero.

FossilOrigin-Name: c56da4bba175cac55ea3f159520a583a8e4739dae77365ffe19e9ffcc5841804
2026-07-06 11:34:46 +00:00
dan
e7738a97c9 Avoid a buffer overread in the session module when an UPDATE change is rebased against a baseline that records fewer columns than the UPDATE. Bug [bugs:/info/2026-07-05T13:57:01Z | 2026-07-05T13:57:01Z].
FossilOrigin-Name: ea26bf3cd7fb1116a8a25e767c54a49ca153c29e243b68e523d79120c5832b1d
2026-07-06 08:36:48 +00:00
drh
2497b685b2 Properly handle errors from the readlink() system call in the
fileio.c extension.
[bugs:/info/2026-07-05T12:06:32Z|Bug 2026-07-05T12:06:32Z]

FossilOrigin-Name: 85effd2ad321fb7f02b42e200ad2ba27323b0e866fa3412a56db32ab8e048df5
2026-07-05 19:18:33 +00:00
drh
bfad7140ac Fix the parse_create_index() SQL function created by the incremental
integrity_check extension so that it works for widely correct CREATE INDEX
statements.
[bugs:/info/2026-07-05T12:00:57Z|Bug 2026-07-05T12:00:57Z].
Also fix the extension so that it removes the parse_create_index() function.
Add the sqlite3_intck_register() API function so that the
parse_create_index() function can be more easily tested.

FossilOrigin-Name: bd28985523b02875b1045652fe29757e5d5519f48e6109ffebc99212314ab69c
2026-07-05 18:28:35 +00:00
drh
7ff247c5b9 Be sure to invoke the authorizer callback on all terms of the USING clause
in a RIGHT JOIN.
[bugs:/info/2026-07-05T08:15:45Z|Bug 2026-07-05T08:15:45Z]

FossilOrigin-Name: bbd69ce27462000873af053bfebdd305c53deac85c426b1e7dbd927b5f17d622
2026-07-05 16:06:33 +00:00
drh
0c3a9d3b0c Add the strdup() SQL function extension for use in testing.
FossilOrigin-Name: 521a7cf8443d914ae0486aa8a91924ed35a1d5b88082acbe513cef216408c97e
2026-07-04 15:09:52 +00:00
drh
c077ff1a07 The jsonSkipLabel() routine, part of json_each() and json_next(), should
never return an index outside of the range of bytes of the input JSONB.
[bugs:/info/2026-07-04T04:58:54Z|Bug 2026-07-04T04:58:54Z]

FossilOrigin-Name: 96072f5f872c8e62dedf48a4ba47ca5f3bd55e98b122f62199a1d0be06de95b4
2026-07-04 12:12:16 +00:00
drh
2f13a51628 Fix possible one-byte OOB read in the fossildelta.c extension.
[bugs:/info/2026-07-04T04:53:59Z|Bug 2026-07-04T04:53:59Z]

FossilOrigin-Name: 8001a373d1c91f92639fb34fca18f9667f1ee92eb6bfa49df06b8cc256385292
2026-07-04 09:22:27 +00:00
drh
40b811a329 Fix possible 1-byte OOB read when decoding a malformed FLOAT5 element
in JSONB.
[bugs:/info/2026-07-04T04:59:19Z|Bug 2026-07-04T04:59:19Z]

FossilOrigin-Name: 6ed20ab693b298b6b645ee73801ee19952e9c188fba93594634325e12de02848
2026-07-04 08:48:52 +00:00
drh
c9a90ce1ec Improved data validation in fts5SecureDeleteOverflow().
[bugs:/info/2026-07-03T19:16:18Z|Bug 2026-07-03T19:16:18Z]

FossilOrigin-Name: bb1588f04a745ff130edf300f1216e0957c0de28734ccdba1b8a6a4a161dbddf
2026-07-03 20:26:45 +00:00
drh
4f670ff013 Avoid an integer overflow in the string allocator for the snippet()
function of FTS3/4, when SQLITE_MAX_LENGTH is unusually large.
[bugs:/info/2026-07-03T18:34:04Z|Bug 2026-07-03T18:34:04Z]

FossilOrigin-Name: b2816b4d6a2a526e50219aad6051627595ae3a02ef125b5026db6e33509efb0c
2026-07-03 19:13:27 +00:00
stephan
a20de6d683 In ext/wasm, add the ability to omit specific JS APIs and VFSes at build-time.
FossilOrigin-Name: 0d70a15c3b35e9af3052042cd5332db1b38a66416f1c3c8a50d342395bf22c01
2026-07-02 09:52:03 +00:00
drh
ebdbae7d9d Enhancements to date/time functions: The "weekday -N" modifier moves
the date backward in time.  The "end of day/month/year" modifiers added.

FossilOrigin-Name: 88901fffcd445ccb97e4e379ea15d8b06d87b8170cad0f717c909944ff21851f
2026-07-01 12:11:41 +00:00
drh
12fad2e03c Add "end of day/month/year" modifiers to date/time functions.
FossilOrigin-Name: 2c4cb3223c6c56d05fe91b8d19b60eac26a274e41f34a2d8f2cf911927581932
2026-07-01 11:57:20 +00:00
drh
762004c309 Enhance the "weekday N" modifier for date/time functions such that if
the argument is negative, it move the date backwards in time to the
matching weekday, rather than forwards.

FossilOrigin-Name: e31bea6ce188fb3ae2d8da132a40a182431d701dc6b991af470337a1cdd3f8e4
2026-07-01 03:02:42 +00:00
drh
f4cf5c9b5d Add new assert()s to help static analyzers realize that the code is correct.
FossilOrigin-Name: 007f0496619e571092382a3668b6bbcc17919908895dc4be71f8d1b6ec2aeeed
2026-06-29 15:11:58 +00:00
stephan
795dffb08e Rename omit-api=all to omit-api=ALL to defend against breaking on a substring match of 'all' in as-yet-hypothetical future feature names.
FossilOrigin-Name: 225dd27e147b46e85097ada7234a307f55842d98155cd36fe00da57744598bc3
2026-06-29 11:59:54 +00:00
stephan
886d2c743e Add worker1 to the list of omit-api=X values, per downstream request. Add omit-api=all shorthand.
FossilOrigin-Name: 97ab248b4dd30de76bfbc74ab5cf087df9cd14fd38eb4369a3eadc75953b8c73
2026-06-29 11:36:44 +00:00
stephan
9dead038a9 Merge in trunk for continued work on this branch.
FossilOrigin-Name: 14bdec7494757679e7d828ad092546db486a62776d06a9b7799dac50f107e10d
2026-06-29 11:22:40 +00:00
drh
a38e6fdf96 Mark shadow tables when registering a new virtual table that already exists
after the schema has loaded.  Test cases in TH3.
[bugs:/info/2026-06-26T12:45:51Z|Bug 2026-06-26T12:45:51Z].

FossilOrigin-Name: 3e80958a7052a123f4599d64baa8cc31a761e5a58d04c75ca38f2a375d247808
2026-06-28 19:05:29 +00:00
drh
831c843112 Fix incorrect header comment on the sqlite3ShadowTableName() function.
Comment chagne only. No changes to code.

FossilOrigin-Name: b5af1a5c7fc8c84e077eb3aa23fbb8712fcaf5143c228db4042f3d811fa6beaf
2026-06-28 16:40:34 +00:00
drh
2a108605a3 Check for oversized iTermOff in fs5SegIterNextInit() and trigger a
corruption error if detected.
[bugs:/info/2026-06-27T18:46:54Z|Bug 2026-06-27T18:46:54Z]

FossilOrigin-Name: 130d4d10dae5957c2be50696545157cd98b6a976affa0c887ff9e1c9e17e97ab
2026-06-28 00:21:50 +00:00
drh
8f384febcc Do not allow an integer overflow to bypass a leaf-term bound check
in the integrity-check function of FTS5.
[bugs:/info/2026-06-27T18:47:28Z|Bug 2026-06-27T18:47:28Z]

FossilOrigin-Name: 74ba971bfafae1eba5e4f4a36e3b31f603f37cdc2010ee09ac251d6e863ac8b0
2026-06-27 23:04:36 +00:00
drh
640578de53 Make sure local functions in the series.c extension have only file scope.
[forum:/info/2026-06-27T20:38:26Z|Forum 2026-06-27T20:38:26Z].

FossilOrigin-Name: d8c59f264bdb4ad927fffd9ce78a36a6754487071ff7ce3316edbd63789d7af2
2026-06-27 21:52:55 +00:00
drh
ce98fde606 In the amatch.c and fuzzer.c extensions (both of which are experimental,
for testing purposes only, and are not part of any deliverable) treat
NULL inputs as empty strings.
[bugs:/info/2026-06-27T19:32:29Z|Bug 2026-06-27T19:32:29Z].

FossilOrigin-Name: 7bcd606c8a2746e3c9258de239e97e14c2e809b91911b1d1b49636dca8fe2d7b
2026-06-27 20:30:17 +00:00
drh
9aee833096 Put reasonable input limits on the (non-deliverable and obsolete)
amatch.c extension.
[bugs:/info/2026-06-27T19:15:11Z|Bug 2026-06-27T19:15:11Z]

FossilOrigin-Name: 2fe1366e649ddd964153059b3c33b380af1924afb59210ac3311fd7bc8af5922
2026-06-27 20:18:46 +00:00
drh
a907dc5d99 Improved detection of CTEs being misused as table-valued functions.
Remove an incorrect assert() from check-in [716782abe939083b].

FossilOrigin-Name: ca197caec7b2b4fd71a9853bb2452b7ce7dd2fbb1bbc871aa375558e53c216f7
2026-06-27 16:07:17 +00:00
drh
e9c7f97871 Add a new sqlite3FaultSim() to make it easier to test the changes
in check-in [942498724f5bb83b].

FossilOrigin-Name: a4472a17e878fce92d88c1db08e7e390df25f6699e801602cc725cbfdb836e9e
2026-06-27 15:25:53 +00:00
dan
f0c63df288 Fix a harmless "jump or move depends on uninitialised value" warning that could occur when using a virtual table as the RHS of an outer join within a trigger.
FossilOrigin-Name: 716782abe939083b7732289d862ddfd841057d3458814f96e5e6d7826ec7fa5c
2026-06-26 19:31:46 +00:00
drh
4c1e43fe0c Enhance the documentation on sqlite3_set_authorizer() to make it clear
that the authorizer callback is not invoked for elements of an expression
in a generated column.
[bugs:/info/2026-06-26T12:42:48Z|Bugs 2026-06-26T12:42:48Z].

FossilOrigin-Name: 45213c1c398cad9d05eda5420ae7379e84fa37d30793f8b4d28c358b88d62931
2026-06-26 15:27:30 +00:00
dan
c631da1fd4 Fix both a buffer overread and overwrite in the sessions rebase module. Bug [bugs:/info/2026-06-26T12:16:48Z | 2026-06-26T12:16:48Z].
FossilOrigin-Name: cc36f1741308ea354d540d27c89b92d69a0481885ca3463bdaf0b9ab27464d78
2026-06-26 15:04:47 +00:00
drh
9954751509 Fix parsing of unterminated "[" tokens in the incremental integrity
check extension.
[bugs:/info/2026-06-26T10:05:53Z|Bug 2026-06-26T10:05:53Z].

FossilOrigin-Name: c8f143bd618fe59c18eb92c8f5ae1b153f03cf05e1c457910f6a46599f719809
2026-06-26 14:36:05 +00:00
drh
f916f72495 Avoid 32-bit integer overflow in the zipfile extension given
ridiculous arguments.
[bugs:/info/2026-06-26T11:40:02Z|Bug 2026-06-26T11:40:02Z]

FossilOrigin-Name: 7eedf458ca4e8e72d309d5d342d364f49950fedca94dc157337e65d766c012c1
2026-06-26 14:20:32 +00:00
dan
73975a8f31 Fix a buffer overread that could occur in fts5 within a memcmp() when doing an integrity-check on corrupted records.
FossilOrigin-Name: 062597f10a6d3f8c959a38e4ab6ee1a885499dd7018662e3e6268b2ee6c63c1b
2026-06-26 14:08:42 +00:00
drh
bfbeb641de Fix parsing of quoted instantiation arguments in the spellfix extension.
[bugs:/info/2026-06-26T10:52:36Z|Bug 2026-06-26T10:52:36Z]

FossilOrigin-Name: c2e963ad948e0c244d6b883b919ec0815c20018282e04e5649c00e70f5a1d2ed
2026-06-26 13:51:48 +00:00
drh
0a54af99a1 Fix unbounded whitespace skip in the decimal extension.
[bugs:/info/2026-06-26T10:06:54Z|Bugs 2026-06-26T10:06:54Z]

FossilOrigin-Name: 71d4cfe5a34cf8485ab2e5abe670381cd068f013233d98c44355a6bcdfcbbbb0
2026-06-26 13:41:07 +00:00
drh
c288de339c Extra margin to prevent queue overflow in the RTree extension.
[bugs:/info/2026-06-26T12:15:33Z|Bug 2026-06-26T12:15:33Z]

FossilOrigin-Name: de40bfb6b39f3252d1dc2dccc04439ac7b40c1331ded60473950cb4b96fc85f7
2026-06-26 13:21:00 +00:00