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

31785 Commits

Author SHA1 Message Date
drh
cbe7e67d7b The value returned by json_each.root should be SQLITE_TRANSIENT, not
SQLITE_STATIC.

FossilOrigin-Name: 65a1a9138873de07df60bbd55e461b922230b645c6f5b6230233585f90208105
2026-09-10 10:25:02 +00:00
drh
325f8529f4 When generating code to evaluate a vector IN constraint where the RHS
of the IN operator is a subquery, if the removeUnindexableInClauseTerms()
subroutine changes the order of terms in the IN operator, then do not
allow the modified IN operator to reuse a previously generated evaluation
of the subquery.

FossilOrigin-Name: 2f95f4a873af70901945bf486e9ec99534994b7dd3d5639a5ab7ce9f0cd96c68
2026-08-24 14:41:51 +00:00
drh
91d0dbd25c Fix the zipvfs virtual table so that it works with UPDATE OR REPLACE.
FossilOrigin-Name: a914d28b02ae45295e570f6ef0c69c02983ee2686ff91edf57fd6e2d52fd2f41
2026-08-19 15:32:38 +00:00
drh
c3b9659a92 Detect and report FTS5 index corruption early enough to prevent CPU stack
overflow.

FossilOrigin-Name: 9e0f6a70965e6c9db57bcae272526c91c3c6e512a44394d7678ef30315466a54
2026-08-19 14:31:33 +00:00
drh
41d42bf5aa Limit the depth of recursion in the internal clearDatabasePage() routine.
Raise a database corruption error if it goes too deep.

FossilOrigin-Name: 0a0740db709632eb9a10193af3b7f49ecccda275ba8f53fc9762ecaf2cbd542d
2026-08-19 12:02:26 +00:00
drh
c47743de13 Prevent a corrupt database from causing a CPU stack overflow in PRAGMA
integrity_check.  Report the excess btree depth instead.

FossilOrigin-Name: 0670d6d6f39c1e1ce67f6d2a96155014a0595211af88f90f0008cd2d1097f535
2026-08-18 13:11:05 +00:00
drh
66dbfda34c Limit the number of nested RIGHT JOINs (or FULL JOINs) that can occur
in a single query.

FossilOrigin-Name: 81561e928514b27f2c4dd3a8b174b02b936cdd3ac73746c1066e822a5cedd278
2026-08-18 10:14:28 +00:00
drh
2cf6637c40 Limit the number of statements in a trigger to 65000.
FossilOrigin-Name: ed8d4fd91e6db4da342ac77282a15a95977e91db81f5a3fd204e6733d1eb262c
2026-08-18 09:23:44 +00:00
drh
ec1ee47f4c Declare fts5 structure records corrupt if they contain a page number greater than 0x7FFFFF00.
FossilOrigin-Name: 14be580d240496f1615dad42c5442443c0629f3aff6ba8ac77485992d5e8d625
2026-08-18 00:30:58 +00:00
drh
aa661c2e67 Avoid a problem causing a use-after-free in the fts3 snippet() function.
FossilOrigin-Name: 9a367c177f4cf7b065e0361ef848ffb2eb4956ef94084f440bc07958ef076bf5
2026-08-18 00:23:42 +00:00
drh
fe650fa6e3 Increment the patch level to 5.
FossilOrigin-Name: f7371f41f96f5b94d037c073863fe94ed8f1f7b9bb050d2d0405e162fcafa318
2026-08-17 13:02:42 +00:00
drh
ca7a4778be Avoid a buffer overrun when processing a strategically corrupted changeset.
FossilOrigin-Name: a1dd7123d87252d9ec801a31f34858fab9b8453b50a20f64bb05075b2b5f85aa
2026-08-17 12:59:08 +00:00
drh
cff880190d When reading a frame from a WAL file where the WAL pagesize and the database
pagesize disagree, be sure to fully initialize the page that is read.

FossilOrigin-Name: 4fde87b2a0f2effb0fd9fa553a955f6509f9659934c1b5bfbc7c02e96ec41487
2026-08-16 10:52:21 +00:00
dan
50563d14a4 Fix a problem in fts5 secure-delete code that could lead to a buffer overrun when dealing with a strategically corrupted database. Problem reported by YEONBA.
FossilOrigin-Name: 34171bee084f70801c1d35f6620313ed5c7684bc94060eb8f19ae3d2408024d2
2026-08-11 14:50:12 +00:00
dan
5dd4cd6b7a Fix a problem causing sessions module conflict handling to malfunction when used with a database handle configured with sqlite3_extended_result_codes(). On this branch, problem first appeared in [919d393a3b] and was released as part of 3.53.3.
FossilOrigin-Name: f1731d830038e3b86ca80e21cabb3c012d1db0956308e4cf3a7f4f1b86651453
2026-08-07 13:38:11 +00:00
drh
ec91a47924 Fix a single byte buffer overrun in the approximate_match extension.
FossilOrigin-Name: 0ae62bb4d910e4f87fa0ba39164a5d72802d11af58cf6b1a37c77085aa28cad0
2026-08-04 14:07:02 +00:00
drh
6b42d0401e In fts5, account for the possibility of negative docids when allocating
a buffer to store the results of merging detail=none prefix lists.

FossilOrigin-Name: f8c72d27b27ccb77312824a118c4dbc422dc98e954a8413d33277a6d9f6b3f53
2026-08-04 12:29:22 +00:00
stephan
4ba5a076b1 Add a test for [012550c089].
FossilOrigin-Name: 6a496de180c342b728f663d771b30fbcae487898d64e9fb4c322f26639d19510
2026-07-26 16:06:30 +00:00
stephan
8f9219d25c Fix a JS container API misuse in sqlite3.oo1.DB.close() which caused its fallback cleanup of still-open statements to not actually do so. Reported off-list by Jure Rotar.
FossilOrigin-Name: 012550c089146772ef576daf9f64db778117b62d3082c0b08130fa39370e82dd
2026-07-26 15:40:37 +00:00
drh
b09c88c140 Version 3.53.4
FossilOrigin-Name: bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc
version-3.53.4
2026-07-24 19:02:57 +00:00
drh
fcd0834ca7 Fix to the interaction between indexes-on-expressions, subtypes, and
the unary "+" operator.

FossilOrigin-Name: 5d7c6fe1e93bec72c5afdf404b5ddd548595488fd420a0e8593487635228fd76
2026-07-24 14:05:22 +00:00
dan
80fd9ec141 Ensure that a hot journal is rolled back in the case where a process or system crash resulted in a corrupt super-journal record where the magic and length values are correct but the super-journal name and checksum fields are both zeroed. Frorum post [forum:/info/2026-07-20T18:27:00Z | 2026-07-20T18:27:00Z].
FossilOrigin-Name: bf70dadc2d455844cfd3e759cc2f78bd38841f7362dde302af3dce0d20303935
2026-07-20 20:15:08 +00:00
drh
e9dd890d9c Add the SQLITE_SHELL_EDITION compile-time option, which if set to a
date number of the form YYYYMMDD will try to configure the defaults
to be similar to the latest release at or prior to that date.

FossilOrigin-Name: 1d84dc151bada74952819b5193a3d39706ef54b6a1b2d52aea04666b7904210f
2026-07-17 00:27:13 +00:00
drh
ee5d76c56d Update some test cases in fts5corrupt3.test and fts5corruptB.test to account for recent updates to database and record corruption detection.
FossilOrigin-Name: a508bb8f88e79742df314e51e6404c964547f811d9361233157cd7a748ddfadb
2026-07-14 14:30:36 +00:00
drh
842b51fc1d Safer conversion from double to 64-bit integer in two places.
FossilOrigin-Name: a210f6f9391ec5a7c360a4784e0dc21937c9ccb2891eb6018cabe7932db5e4a0
2026-07-14 10:31:13 +00:00
drh
6b5272d8a7 Ensure that the "leaf-size" field of an fts5 record is only read from records that are actually leaves and are large enough to contain it.
FossilOrigin-Name: 7bad71288c6547964c36215938c1d16dd38d973ef8586f1a33814e83ee5a28f5
2026-07-09 21:10:01 +00:00
drh
ace7cf321b In the sqlite3_rsync utility program, fix three defects identified
by Anthropic.

FossilOrigin-Name: b6ab126399a5df66f0f9f4acea470afe8b8b42a28cc679f42e36bd77c1ac3d77
2026-07-09 17:13:12 +00:00
drh
4825267c06 Fix an incorrect free() call in the CLI on Windows when using the -A
command-line option.

FossilOrigin-Name: 74a4c3b666c9a8a23f22f4c5a7e039f08adac2bde45fec0349983c262631a19e
2026-07-08 20:33:08 +00:00
drh
c0c8251568 Fix an OOB read caused by passing an out-of-range phrase number to fts5 auxiliary API xPhraseFirstColumn() in detail=columns mode.
FossilOrigin-Name: 9aac477d65a948b3f32922899b7efbdba72faa48ac9a53cb356feafecffa9c8d
2026-07-06 16:55:39 +00:00
drh
2cf7691506 Fix another buffer overread in RBU that could occur when processing an RBU database with corrupt rbu_control fields.
FossilOrigin-Name: dd482ecec3256349799fd0c8515c133539552845aef7134a82388c748bec59b0
2026-07-06 16:52:58 +00:00
drh
3e02bd230c Fix mulutiple problems in RBU and reduce divergence between the Fossil
native implementation of delta and the variant of that code used by RBU.

FossilOrigin-Name: 6870e39ecc3425db7b80432ca4cf5b9f75615f58140192557d18ed6f432f46cd
2026-07-06 16:46:25 +00:00
drh
a3542dccaa Avoid a (harmless) 1-byte OOB read due to malformed inputs in the
normalize.c extension.

FossilOrigin-Name: a6cdeee6e63e3635373d7ecfdefb99b2d607290b4e419dcd37e7eed3e73a5a2c
2026-07-06 13:57:07 +00:00
drh
88c6a2e7bc Return an error if a patchset is passed to sqlite3rebaser_configure().
And avoid a buffer overread in the session module when an UPDATE change
is rebased against a baseline that records fewer columns than the UPDATE.

FossilOrigin-Name: 37c90c8fc2d694dabc7c8e7fd49ae2ab46f91f9b88fd7c829b72225881598495
2026-07-06 13:41:48 +00:00
drh
bd57e2ebb2 Properly handle errors from the readlink() system call in the
fileio.c extension.

FossilOrigin-Name: b6500b6bf167fdbef1e25322c15d8cf54ff11bc47b869af3ed4a8fc8e45e9e5c
2026-07-05 19:24:50 +00:00
drh
fe580a88ec Fix the parse_create_index() SQL function created by the incremental
integrity_check extension so that it works for widely correct CREATE INDEX
statements.
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: 88bfcc736144c8b2c8c2c1797a091f03d95da5dcce8a17112c3d724dc1d02813
2026-07-05 19:18:45 +00:00
drh
4ac070dd77 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.

FossilOrigin-Name: 4ccbd6042af59899c843aa652445675b76931cc880002d34be8d22d597955602
2026-07-04 12:16:31 +00:00
drh
ade5e04510 Fix possible one-byte OOB read in the fossildelta.c extension.
FossilOrigin-Name: 3d6c32fc0797d97196cc16f66aa00890b5c03e241a5632a0ab27cc46c33a19a3
2026-07-04 09:28:12 +00:00
drh
c8074bb0d7 Fix possible 1-byte OOB read when decoding a malformed FLOAT5 element
in JSONB.

FossilOrigin-Name: a43c78f9f6a4a83b9bffd519a1a5634086653c8ac94ead9752fef690a4e20e5a
2026-07-04 08:52:54 +00:00
drh
78d1f78ccd Improved data validation in fts5SecureDeleteOverflow().
FossilOrigin-Name: c87fc653b0bafb23063d38c9fcd059eaeedadcb7bb920a6121665850879146c5
2026-07-03 22:59:25 +00:00
drh
dcff2fa3f7 Avoid an integer overflow in the string allocator for the snippet()
function of FTS3/4, when SQLITE_MAX_LENGTH is unusually large.

FossilOrigin-Name: 38bb8275005c3d293d1b9174450a6bb8ce2ddbca1f5d1d5e457b999f0a002d4c
2026-07-03 19:19:01 +00:00
drh
258595adb3 Check for oversized iTermOff in fs5SegIterNextInit() and trigger a
corruption error if detected.

FossilOrigin-Name: 833d058ee396a9578316b4ef2e13214cbd265999a78d7f08b5c7e515abb32881
2026-06-28 00:24:37 +00:00
drh
450db5fbb4 Do not allow an integer overflow to bypass a leaf-term bound check
in the integrity-check function of FTS5.

FossilOrigin-Name: f45d03b1c52ae102eb92b4de21d6a5265831cfd47e51e3193b38d60744c2e0cf
2026-06-27 23:09:49 +00:00
drh
1d6e8d6c2f Make sure local functions in the series.c extension have only file scope.
FossilOrigin-Name: 713f3cf69a5e49e17785a020af7448f2882059ad41468fd45d981c90e0be1db2
2026-06-27 21:57:19 +00:00
drh
00f5dc622a 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.  Limit input lengths in amatch.c

FossilOrigin-Name: 3c8ba6dca0dcb64c21212685ca4234090e0c73fac3bdebc3f159ff03d0d93f3c
2026-06-27 20:35:10 +00:00
drh
9d7dbd4a2f Patch level to 4.
FossilOrigin-Name: 65214f43c82c5df99fa0ef4d13456d6293f3a96bb8ab11de8c534f9ca32985c7
2026-06-27 20:19:50 +00:00
drh
92a6c5c363 Version 3.53.3
FossilOrigin-Name: d4c0e51e4aeb96955b99185ab9cde75c339e2c29c3f3f12428d364a10d782c62
version-3.53.3
2026-06-26 20:14:12 +00:00
dan
3cc868b7c0 Have API functions sqlite3_serialize, sqlite3_limit, sqlite3_busy_timeout, sqlite3_error_offset, sqlite3_db_name, sqlite3_get_autocommit, sqlite3_errcode, sqlite3_total_changes64, sqlite3_changes64, sqlite3_last_insert_rowid and sqlite3_expired take and hold the database mutex while running.
FossilOrigin-Name: 0d57a60060ee822137f3c1cf7ba1cf40ded024d038981bd51b9cab3bf7f42b2f
2026-06-26 17:36:58 +00:00
drh
e151b6e4a1 Fix both a buffer overread and overwrite in the sessions rebase module.
FossilOrigin-Name: 12d0d2363a3082f68153393ed1aa91264ee987bc9187e7afd131d503f66e4faa
2026-06-26 15:17:08 +00:00
drh
a9fc90f932 Fix parsing of unterminated "[" tokens in the incremental integrity
check extension.

FossilOrigin-Name: 6a55dc85b73ef98f0ef31d7b0740bfe46ebb25653f2dff4eb34074d1b455925a
2026-06-26 14:47:07 +00:00
drh
948ff608ca Avoid 32-bit integer overflow in the zipfile extension given
ridiculous arguments.

FossilOrigin-Name: 2e1fdfbcc91da03795d6bb27980a329dc710d5c4c8540aa6e77413e29210be0e
2026-06-26 14:22:53 +00:00