Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream SQLite 3.45.1 #1054

Open
wants to merge 536 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
536 commits
Select commit Hold shift + click to select a range
e09a38c
Remove unused elements from the json_tree() cursor.
Nov 25, 2023
50b3783
Same results as the legacy JsonNode implementation on a small set of …
Nov 26, 2023
15c0b03
Fix corner-case error conditions.
Nov 26, 2023
b4e5bc6
All tests passing.
Nov 27, 2023
85eafe6
Convert the json_tree() and json_each() virtual tables over to use JS…
Nov 27, 2023
821a4c9
Give the json_valid() function an optional second argument that deter…
Nov 27, 2023
8a3034a
Enhance the (SQLITE_DEBUG-only) json_parse() routine so that it shows a
Nov 27, 2023
e52854a
In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of…
Nov 27, 2023
bae2d0f
Have SQLITE_ENABLE_SETLK_TIMEOUT builds block when locking a read-loc…
Nov 27, 2023
eb04a0b
Add untested (#ifdefed-out) code for the MergePatch algorithm against…
Nov 27, 2023
f46f89d
More aggressive use of jsonBlobEdit(). Improvements to the MergePatch
Nov 28, 2023
5026ddb
The json_patch() code for JSONB compiles and works sometimes, but the…
Nov 28, 2023
ec1f59f
All legacy tests are passing.
Nov 28, 2023
26cd4b5
Activate the ability of json_patch() to work on JSONB.
Nov 28, 2023
b8950e0
Handle an SQLITE_BUSY_TIMEOUT error if one occurs while attempting a …
Nov 28, 2023
940b23b
In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of…
Nov 28, 2023
ef97f83
The json_remove() function now uses only JSONB, never JsonNodes, inte…
Nov 28, 2023
0d4a888
Merge latest trunk updates into this branch.
Nov 28, 2023
1cab41e
Attempt to get json_extract() working with pure JSONB only, and without
Nov 28, 2023
1ef232c
Preserve flexibility in the format of the RHS of -> and ->> operators…
Nov 28, 2023
1f8c7c7
Do not set the J subtype when the output is JSONB.
Nov 28, 2023
748178a
Fix all known problems with JSONB json_extract().
Nov 28, 2023
4b54d6c
Convert the json_array_length() function to use JSONB instead of Json…
Nov 29, 2023
2ba5534
The assertion change at check-in [7946c79567b0ccd3] is insufficient t…
Nov 29, 2023
6d7afd8
Merge all the latest trunk enhancements into the jsonb branch.
Nov 29, 2023
ed088f5
In the recovery extension, if a payload size is unreasonably large, i…
Nov 29, 2023
89fcfbb
Fix signed integer overflow in fts5.
Nov 29, 2023
da25783
The json_patch() function now operates exclusively on JSONB. This patch
Nov 29, 2023
694beec
Convert the json_error_position() routine to use only JSONB internally.
Nov 29, 2023
bfc7e62
Convert json_insert(), json_replace(), json_set() to use JSONB intern…
Nov 30, 2023
bac2fe9
Update some OPFS-related help text in WASM tests. Minor cleanups in s…
Nov 30, 2023
ad27c43
New test cases for insert/set/replace with paths that indicate substr…
Nov 30, 2023
48222be
New JSON test cases showing insert or set with missing substructure.
Nov 30, 2023
7394a6e
Simplification of the new JSON insert/set test cases.
Nov 30, 2023
6679596
Enhance json_set() and json_insert() so that they create missing
Nov 30, 2023
0ab1e25
Convert json_insert(), json_replace(), and json_set() over to using only
Nov 30, 2023
276042b
Convert json_type() to use JSONB internally.
Nov 30, 2023
68003d9
Add a basic batch-mode SQL runner for the SAH Pool VFS, for use in co…
Nov 30, 2023
38aeb97
Convert json_valid() over to using only JSONB as its internal format.
Nov 30, 2023
4b9ed1b
Remove all trace of JsonNode from the JSON implementation. The JSONB…
Nov 30, 2023
ca1ce77
First attempt to get the JSON text-to-binary cache working. All test…
Dec 1, 2023
5bfa7e6
Cache is working better, but does not preserve the hasJson5 flag.
Dec 1, 2023
063d0d4
Fix up the JSON cache to work better.
Dec 1, 2023
03075fa
JSON cache is now more effective.
Dec 1, 2023
b5effc0
Different approach to querying a tokendata=1 table. Saves cpu and mem…
Dec 1, 2023
ebd173a
Merge latest trunk with this branch.
Dec 1, 2023
f4c2962
Remove old code for tokendata=1 queries.
Dec 1, 2023
3af20cf
Performance optimization in the JSON parser.
Dec 1, 2023
5ec9c91
Fix harmless compiler warnings and enhance performance the parser.
Dec 2, 2023
6df6198
Unroll a loop in the parser for a performance increase.
Dec 2, 2023
768b6e3
Remove a NEVER that can be true if a virtual table column is declared…
Dec 2, 2023
679c908
Simplification and optimization of the JSON parser.
Dec 2, 2023
f0b8b16
Performance optimization in jsonAppendString().
Dec 2, 2023
82136d9
Minor fix to the header comment on jsonXlateTextToBlob().
Dec 2, 2023
4cd397c
Fix potential unsigned integer underflow in jsonAppendString().
Dec 2, 2023
2c26bde
Do not allow a JsonParse object to be considered "editable" after an …
Dec 2, 2023
05db513
Protect a memcpy() against OOM conditions.
Dec 2, 2023
c44041e
Ensure that tokendata=1 queries avoid loading large doclists for quer…
Dec 2, 2023
a11aaff
Take extra care to ensure that JSONB values that are in cache are act…
Dec 2, 2023
94c5212
When tokendata=1 queries require multiple segment-cursors, allow thos…
Dec 2, 2023
53c2160
Fix harmless compiler warnings. Refactor some identifier names for
Dec 2, 2023
c1e8574
Code and comment cleanup. Everything should work the same.
Dec 2, 2023
c22d2b7
Fix various compiler warnings and other problems with the new code on…
Dec 2, 2023
8f8d481
Fix harmless compiler warnings reported by MSVC.
Dec 2, 2023
c78c3c9
Implement strict JSONB checking in the json_valid() function.
Dec 2, 2023
eb18ae3
Minor code changes for consistency and to simplify testing.
Dec 3, 2023
78fa018
Do not let bad hexadecimal digits in malformed JSONB cause an asserti…
Dec 3, 2023
0a18a58
Enable incorrect JSONB to be rendered into text without hitting an
Dec 3, 2023
a3bf077
Ensure that OOM conditions in the generation of the "bad JSON path" e…
Dec 3, 2023
16e8a5b
Avoid problems when the path argument to json_tree() contains embedde…
Dec 3, 2023
9af45dc
Remove dead code. Improved reporting of errors in JSON inputs.
Dec 3, 2023
b7fd951
Back off on the use of strlen() for situations where sqlite3_value_by…
Dec 4, 2023
2ff73a5
Better pre-scan size estimations for objects in the JSON parser resul…
Dec 4, 2023
dc138cb
Repair issues and inefficiencies found during testing.
Dec 4, 2023
43b4864
Add tests for using tokendata=1 and contentless_delete=1 together.
Dec 4, 2023
732fb64
Two new NEVER macros.
Dec 4, 2023
99c4169
Remove reachable ALWAYS and NEVER macros.
Dec 4, 2023
9d373ca
Fix bug in xInstToken() causing the wrong token to be returned.
Dec 4, 2023
9c794b9
Continuing simplifications and code cleanup.
Dec 4, 2023
3dfc063
Fix a problem with the xInstCount() API and "ORDER BY rank" queries.
Dec 4, 2023
910c77b
Fix memory leak in new code on this branch.
Dec 4, 2023
54318b3
Fixes for xInstToken() with tokendata=0 tables. And with prefix queries.
Dec 4, 2023
3fedb7e
Fix errors in rendering JSON5 escape sequences embedded in JSONB.
Dec 4, 2023
0b8b1c3
Do not make the input JSONB editable in json_remove() if there are no…
Dec 4, 2023
f26e26a
Fixes to error handling in json_array_length().
Dec 4, 2023
49bfbc1
Add further tests for xInstToken().
Dec 4, 2023
3cdb079
Rename the internal routine jsonMergePatchBlob() to just jsonMergePat…
Dec 4, 2023
ae2e972
Fix OOM and corrupt JSONB handling in json_patch().
Dec 5, 2023
fa43e21
Use an assert() to fix a harmless static analyzer warning.
Dec 5, 2023
78f7d2f
Clean up the JSONB performance test script.
Dec 5, 2023
590aaff
Small performance gain by unwinding the string literal delimiter search
Dec 5, 2023
8eac91f
Use strspn() to accelerate whitespace bypass in the JSON parser.
Dec 5, 2023
a0de454
Miscellaneous comment cleanup and typo fixes.
Dec 5, 2023
fb923fc
Further tests for the new code on this branch.
Dec 5, 2023
5afd67b
Use extra assert() statement to silence harmless static analyzer warn…
Dec 5, 2023
8820829
Rework the JSON functions so that they use the JSONB format internally.
Dec 5, 2023
1f2d7c4
README.md typo fix reported in the forum and update all links from ht…
Dec 6, 2023
39b08db
Merge trunk changes into this branch.
Dec 6, 2023
e751596
Add the tokendata=1 option and related APIs to fts5.
Dec 6, 2023
91ec00c
Increased rigor in comparisons between object labels in JSON.
Dec 6, 2023
6a8581d
The rule for the RHS of the ->> and -> operators when the RHS does no…
Dec 6, 2023
8dfbf4a
Test cases for object label matching with escape sequences.
Dec 6, 2023
3207199
In CLI, move -interactive flag handling back to arg-loop pass 2.
Dec 6, 2023
9df01b5
Fix the routine that determines the json_tree.path value for the firs…
Dec 6, 2023
b597fea
Correctly handle 8-byte sizes in the JSONB format.
Dec 6, 2023
a9c8469
Do correct comparisons between object labels in JSON even when the tw…
Dec 6, 2023
83ac792
Update documentation comments in fts5.h.
Dec 6, 2023
82fc1b6
Work around LLVM's newfound hatred of function pointer casts.
Dec 6, 2023
00f3ac5
Fix compiler warning about shadowed variable in fts5_index.c.
Dec 6, 2023
5b6b703
Improved detection of corrupt JSONB in the jsonReturnFromBlob() funct…
Dec 7, 2023
f86a07b
Add ALWAYS() on branches added in [ec0ae4030968c782] that are always …
Dec 7, 2023
5a238ff
Rework the jsonEachPathLength() routine in json_tree() so that it is
Dec 7, 2023
2f3ccb8
Different fix for the fts5 COMMIT-following-OOM problem first fixed b…
Dec 7, 2023
5f2f8d0
Fix a problem with handling OOM and other errors in fts5 when queryin…
Dec 7, 2023
1ddcf7d
Fix a null-pointer dereference in fts5 tokendata=1 code.
Dec 7, 2023
7c12666
Avoid an assert() failure when querying an fts5vocab table that acces…
Dec 7, 2023
0b427eb
Ensure an fts5vocab table never uses a special tokendata=1 merge cursor.
Dec 7, 2023
05980f5
Avoid dropping an error code in new fts5 tokendata=1 code.
Dec 8, 2023
9d2446d
Fix a harmless compiler warning about "confusing indentation".
Dec 8, 2023
2a27be2
Fix a potential problem RCStr access on a JsonString object that is not
Dec 8, 2023
bfa0de8
Fix a harmless UBSAN warning.
Dec 8, 2023
b89e64d
Fix a potential use of uninitialized value in json_valid() with 2nd
Dec 11, 2023
ce46e0e
Work toward enhanced functionality for json_valid() with deep checking
Dec 11, 2023
7d2eaae
Add SQLITE_TESTCTRL_VALIDATE_JSONB, which if enabled under SQLITE_DEB…
Dec 11, 2023
ba55056
Rename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK. Make …
Dec 11, 2023
7445659
Activate JSON_SELFCHECK within fuzzcheck.
Dec 11, 2023
001caa7
json_valid(*,8) allows minus-signs on hexadecimal literals.
Dec 11, 2023
5a890b4
json_error_position() now uses jsonValidityCheck() to find the approx…
Dec 11, 2023
ad6bc61
The json_error_position() function now reports an approximate byte of…
Dec 11, 2023
cc1a39f
Validity checking of text nodes in JSONB.
Dec 12, 2023
87399a5
Improvements to JSONB validation - catch more cases where the input does
Dec 12, 2023
78e636b
Add NEVER to two unreachable branches in JSON.
Dec 12, 2023
df25a8f
The json_valid(*,8) function does a much better check of the validity of
Dec 12, 2023
9710fa1
Worker1 Promiser API: when multiple db connections are active then us…
Dec 12, 2023
891f1dc
Fix the JSON object label comparison object so that it works correctl…
Dec 12, 2023
001d1e7
Improvements to UTF8 handling, and especially the handling of invalid…
Dec 13, 2023
f7c78a2
Bug fix in the JSONB validator.
Dec 13, 2023
3e4195c
Avoid invoking sqlite3ExprColUsage() on an unresolve column reference.
Dec 13, 2023
9e488a5
In CLI, fix .read inability to open 2GB+ files on WIN32.
Dec 13, 2023
07117f8
Pass subtype information through the aggregate ORDER BY sorter for
Dec 14, 2023
8a861a8
Enhance aggregate order-by so that it transmits subtype information t…
Dec 14, 2023
e6289d6
Improve the error message returned by an fts5 'rebuild' command on an…
Dec 14, 2023
4a5c96a
Fix harmless compiler warnings in JSON and FTS5.
Dec 14, 2023
eb78d56
Add assert()s to FTS5 to fix static analyzer warnings.
Dec 14, 2023
e982385
Use SQLITE_STRICT_SUBTYPE=1 by default for the JNI and WASM builds un…
Dec 14, 2023
f062506
Correct --enable-sab flag in ext/wasm/GNUmakefile to fix a silent alh…
Dec 15, 2023
76dbb58
Avoid running the "no_mutex_try" tests with SQLITE_ENABLE_SETLK_TIMEO…
Dec 15, 2023
f219460
Do not run test script fts5origintest4.test with either "memsubsys1" …
Dec 15, 2023
baa1aba
Fix a new JSON test case so that it works even if SQLITE_OMIT_VIRTUAL…
Dec 15, 2023
b7fad0d
Add mention of --buildonly and --dryrun to the testrunner.tcl usage s…
Dec 15, 2023
97f7ead
Avoid expiring prepared statements in the middle of an integrity-check.
Dec 15, 2023
40e614e
In the count-of-view optimization, deferring freeing obsolete parts o…
Dec 15, 2023
5f3dd86
New test case based on Chromium bug report 1511689.
Dec 16, 2023
1326441
Enable SQLITE_STRICT_SUBTYPE for default builds of the shell, fuzzcheck,
Dec 16, 2023
0d20159
Enhancements to the "randomjson.c" extension. Automatically load tha…
Dec 17, 2023
2ae9564
Enhancements to ext/misc/randomjson.c.
Dec 18, 2023
52a4691
Bug fix in the randomjson.c extension.
Dec 18, 2023
0a46ff9
Ensure that all object labels for individual objects generated by
Dec 18, 2023
cf6fe5a
Add randomjson.c to testfixture. Use it for a new set of invariant t…
Dec 18, 2023
095f2c5
Ensure that the insert/delete size delta on JSONB objects in the JSON…
Dec 18, 2023
fc76750
Fix JSON to JSONB translation so that it deals correctly with Infinity
Dec 18, 2023
c4dd6b4
Add NEVER() to an unfalsifiable branch.
Dec 18, 2023
d9252d0
New JSON invariant test cases.
Dec 18, 2023
459f7b1
Remove a stray comment in the JSON code.
Dec 19, 2023
a3569fb
Extra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() r…
Dec 19, 2023
3a0e826
Always make the sqlite_dbdata virtual table available in the CLI.
Dec 19, 2023
60c435d
When unable to resolve an identifier, change the Expr node into TK_NULL
Dec 19, 2023
9c36095
Test case for the previous check-in.
Dec 19, 2023
3e2ec83
Ignore COLLATE operators when determining whether the result of a sub…
Dec 19, 2023
09259af
Add ALWAYS() and NEVER() on branches made unreachable by recent changes.
Dec 19, 2023
611b9d3
More precise computation of the size of data structures in the query …
Dec 19, 2023
4449a1b
Fix harmless compiler warning in the randomjson.c extension.
Dec 19, 2023
7c1033b
On second thought, we don't really need sqlite_dbdata accessible to t…
Dec 19, 2023
c52aebb
Remove redundant conditional from sqlite3ExprCanBeNull().
Dec 19, 2023
3262ca8
In JSON - minor code cleanup and refactoring with a small size reduction
Dec 19, 2023
95cf958
Avoid harmless integer overflow in pager status statistics gathering.
Dec 20, 2023
0d7f0e4
Fix SQLITE_ENABLE_SETLK_TIMEOUT assert() statements in os_unix.c to a…
Dec 20, 2023
c2eff91
Add internal core-developer-only documentation of the JSONB format.
Dec 21, 2023
15bff25
Add a new comment to debugging output routine sqlite3WhereLoopPrint() to
Dec 22, 2023
0810150
Fix a usan complaint about signed integer overflow.
Dec 22, 2023
09e6c82
Update #ifdef checks in pager.c and util.c to account for [0462a2612d…
Dec 22, 2023
ba5043f
Add the -fno-sanitize-recover=undefined to the sanitizer builds used …
Dec 22, 2023
8a630c2
Change parameters on a debugging function to include "const".
Dec 22, 2023
4ed0b11
Add debugging output routines sqlite3ShowWhereLoop(X) and
Dec 23, 2023
57c9874
Improvements to the query planner to address the inefficiency described
Dec 23, 2023
c1805ab
Avoid signed integer overflow during integrity_check of FTS5.
Dec 24, 2023
5a85cf5
Fix harmless compiler warnings associated with [5db30bcc338aac1c]
Dec 24, 2023
71a32ae
Remove an ALWAYS() added in [c50e6c2ace49d092] because it is sometime…
Dec 24, 2023
b2b7490
Improved handling of malformed unicode within JSON strings.
Dec 26, 2023
d82320a
Ensure that the xColumnText(), xQueryPhrase() and xPhraseFirstColumn(…
Dec 26, 2023
d9ac37f
Fix a problem in the shell tool (not library) causing an out-of-bound…
Dec 27, 2023
0546a28
Enhance the (undocumented, debug-only) json_parse() SQL function so t…
Dec 28, 2023
42203e1
Fix harmless compiler warnings in FTS5.
Dec 28, 2023
4c13d3c
Performance improvement by unwinding a loop in jsonAppendString().
Dec 28, 2023
751c4e2
Update fts5origintext4.test to work with SQLITE_DIRECT_OVERFLOW_READ.
Dec 28, 2023
2aae3a9
Enable SQLITE_DIRECT_OVERFLOW_READ unless it is specifically disabled…
Dec 28, 2023
e24cd27
Minor doc touchup in the JS bits.
Dec 29, 2023
7a482b3
Use SQLITE_ENABLE_STAT4 in both the WASM and JNI builds.
Dec 31, 2023
805cd39
WASM: various build cleanups and add initial infrastructure for a bui…
Jan 1, 2024
307f326
JNI: move the ByteBuffer-using APIs from public to package visibility…
Jan 1, 2024
4ccf707
Extra steps taken to avoid using low-quality indexes in a query plan.
Jan 1, 2024
4cfc19f
Remove some unnecessary computations from ANALYZE so that ANALYZE run…
Jan 1, 2024
92e970a
New logic to avoid using indexes that ANALYZE has identified as of li…
Jan 1, 2024
fe1d821
Back out [99d11e6d0ae6] (enabling of STAT4 in WASM/JNI), per /chat di…
Jan 1, 2024
3d4d3fb
Update and clean up the in-makefile docs for ext/wasm.
Jan 2, 2024
aff7664
Elaborate on the various build flavors used by ext/wasm/. Doc changes…
Jan 2, 2024
533622f
Increase the default "max_page_count" to its theoretical maximum of
Jan 2, 2024
4eb6263
Fix a problem in fts5 caused by a COMMIT involving fts5 data that imm…
Jan 2, 2024
f5740f7
Adjust the sqlite3PagerDirectReadOk() routine (part of the
Jan 2, 2024
d059153
Back out [b517a52fa36df0a0] which is no longer reachable due to early
Jan 2, 2024
4167033
Update the sqldiff.exe utility program so that it uses the sqlite3_str
Jan 3, 2024
6db9206
Enhance sqlite3_analyzer.exe so that it uses the ext/consio extension.
Jan 3, 2024
433e904
Change a constant from decimal to hex to avoid a compiler warning on …
Jan 3, 2024
4093b29
Convert the JSON functions to use lookaside memory allocation whenever
Jan 3, 2024
aa08f88
Fix a #ifdef in sqlite3_test_control() that was preventing builds with
Jan 3, 2024
267721e
Restructure some code to fix what appears to be a false-positive UBSA…
Jan 4, 2024
de70e8b
Avoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and…
Jan 4, 2024
76da0dc
Avoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and…
Jan 4, 2024
1cfc040
Update extension ext/misc/totext.c to avoid both ubsan warnings and d…
Jan 5, 2024
f537bba
Update extension ext/misc/totext.c to avoid both ubsan warnings and d…
Jan 6, 2024
1ba1384
Update JSON performance testing procedures for clarity and to describ…
Jan 6, 2024
4e50f77
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_E…
Jan 6, 2024
cd6ea30
Updates to RTREE to facility testing.
Jan 7, 2024
bf64cbd
Remove an ALWAYS() from RTREE. Dbsqlfuzz found a way to make it false.
Jan 7, 2024
f640f79
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_E…
Jan 8, 2024
3e2ffbd
Minor change to os_unix.c to facilitate 100% MC/DC testing.
Jan 8, 2024
7cda91c
Automatically turn off DEFENSIVE mode in the shell tool when executin…
Jan 8, 2024
62f0c4d
Fix date on new file shell9.test.
Jan 8, 2024
e452bf4
Automatically turn off DEFENSIVE mode in the shell tool when executin…
Jan 8, 2024
ff6905a
Improved resolution of unqualified names in the REINDEX command.
Jan 9, 2024
5fdabcf
Put an SQLITE_ENABLE_SETLK_TIMEOUT branch inside the appropriate ifde…
Jan 9, 2024
c08a8a3
In fts5, flush the contents of the in-memory hash table whenever the …
Jan 11, 2024
e5b2132
Fix a comment in sessions. No functional changes.
Jan 11, 2024
4c65542
Have the shell tool automatically enable SQLITE_CONFIG_DQS_DDL when e…
Jan 12, 2024
f352e0a
Version 3.45.0
Jan 15, 2024
0dfdf2d
wasm build: reformulate an awk invocation to account for awks which d…
Jan 16, 2024
b5c5f36
When backing out a character in a constructed string in JSON, first m…
Jan 20, 2024
f05bd8b
Ensure that the xIntegrity methods of fts3 and fts5 work on read-only…
Jan 23, 2024
5b9e435
When a JSON input is a blob, but it looks like valid JSON when cast t…
Jan 23, 2024
1e47802
Bump the version number to 3.45.1
Jan 23, 2024
e8df88e
Fix harmless "unused parameter" compiler warning in the new fts3Integ…
Jan 23, 2024
a8556ee
In os_unix.c and os_win.c, do not allow xFetch() to return a pointer …
Jan 23, 2024
00af690
Slight adjustment to test results for Windows in mmap1.test due to
Jan 23, 2024
f032114
Apply the same fix found in [99057383acc8f920] to descending scans.
Jan 28, 2024
e6a5056
Automatically disable the DISTINCT optimization during query planning…
Jan 28, 2024
f838022
When rendering JSONB back into text JSON, report an error if a zero-l…
Jan 29, 2024
3ff77c5
Avoid a potential buffer overread when handling corrupt json blobs.
Jan 29, 2024
651dcec
Detect malformed nested JSONB earlier and stop rendering to avoid long
Jan 29, 2024
189e44d
Version 3.45.1
Jan 30, 2024
0754565
Merge upstream SQLite 3.45.1
penberg Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 35 additions & 11 deletions libsql-sqlite3/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ TESTSRC += \
$(TOP)/ext/misc/percentile.c \
$(TOP)/ext/misc/prefixes.c \
$(TOP)/ext/misc/qpvtab.c \
$(TOP)/ext/misc/randomjson.c \
$(TOP)/ext/misc/regexp.c \
$(TOP)/ext/misc/remember.c \
$(TOP)/ext/misc/series.c \
Expand Down Expand Up @@ -637,6 +638,7 @@ SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1
FUZZERSHELL_OPT =
FUZZCHECK_OPT += -I$(TOP)/test
FUZZCHECK_OPT += -I$(TOP)/ext/recover
Expand Down Expand Up @@ -667,14 +669,17 @@ FUZZCHECK_OPT += \
-DSQLITE_MAX_MMAP_SIZE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_PRINTF_PRECISION_LIMIT=1000 \
-DSQLITE_PRIVATE=""
-DSQLITE_PRIVATE="" \
-DSQLITE_STRICT_SUBTYPE=1 \
-DSQLITE_STATIC_RANDOMJSON

FUZZCHECK_SRC += $(TOP)/test/fuzzcheck.c
FUZZCHECK_SRC += $(TOP)/test/ossfuzz.c
FUZZCHECK_SRC += $(TOP)/test/fuzzinvariants.c
FUZZCHECK_SRC += $(TOP)/ext/recover/dbdata.c
FUZZCHECK_SRC += $(TOP)/ext/recover/sqlite3recover.c
FUZZCHECK_SRC += $(TOP)/test/vt02.c
FUZZCHECK_SRC += $(TOP)/ext/misc/randomjson.c
DBFUZZ_OPT =
ST_OPT = -DSQLITE_OS_KV_OPTIONAL

Expand Down Expand Up @@ -757,6 +762,21 @@ fuzzcheck-asan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
fuzzcheck-ubsan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
$(LTLINK) -o $@ -fsanitize=undefined $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)

# Usage: FUZZDB=filename make run-fuzzcheck
#
# Where filename is a fuzzcheck database, this target builds and runs
# fuzzcheck, fuzzcheck-asan, and fuzzcheck-ubsan on that database.
#
# FUZZDB can be a glob pattern of two or more databases. Example:
#
# FUZZDB=test/fuzzdata*.db make run-fuzzcheck
#
run-fuzzcheck: fuzzcheck$(TEXE) fuzzcheck-asan$(TEXE) fuzzcheck-ubsan$(TEXE)
@if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi
./fuzzcheck$(TEXE) --spinner $(FUZZDB)
./fuzzcheck-asan$(TEXE) --spinner $(FUZZDB)
./fuzzcheck-ubsan$(TEXE) --spinner $(FUZZDB)

ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
$(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
$(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS) $(OPT_STATIC_LIBLIBSQL_WASM)
Expand Down Expand Up @@ -1193,19 +1213,21 @@ keywordhash.h: $(TOP)/tool/mkkeywordhash.c
# Source files that go into making shell.c
SHELL_SRC = \
$(TOP)/src/shell.c.in \
$(TOP)/ext/misc/appendvfs.c \
$(TOP)/ext/consio/console_io.c \
$(TOP)/ext/consio/console_io.h \
$(TOP)/ext/misc/appendvfs.c \
$(TOP)/ext/misc/completion.c \
$(TOP)/ext/misc/decimal.c \
$(TOP)/ext/misc/basexx.c \
$(TOP)/ext/misc/base64.c \
$(TOP)/ext/misc/base85.c \
$(TOP)/ext/misc/decimal.c \
$(TOP)/ext/misc/basexx.c \
$(TOP)/ext/misc/base64.c \
$(TOP)/ext/misc/base85.c \
$(TOP)/ext/misc/fileio.c \
$(TOP)/ext/misc/ieee754.c \
$(TOP)/ext/misc/regexp.c \
$(TOP)/ext/misc/series.c \
$(TOP)/ext/misc/ieee754.c \
$(TOP)/ext/misc/regexp.c \
$(TOP)/ext/misc/series.c \
$(TOP)/ext/misc/shathree.c \
$(TOP)/ext/misc/sqlar.c \
$(TOP)/ext/misc/uint.c \
$(TOP)/ext/misc/uint.c \
$(TOP)/ext/expert/sqlite3expert.c \
$(TOP)/ext/expert/sqlite3expert.h \
$(TOP)/ext/misc/zipfile.c \
Expand All @@ -1214,7 +1236,7 @@ SHELL_SRC = \
$(TOP)/ext/recover/dbdata.c \
$(TOP)/ext/recover/sqlite3recover.c \
$(TOP)/ext/recover/sqlite3recover.h \
$(TOP)/src/test_windirent.c
$(TOP)/src/test_windirent.c

shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl has_tclsh84
$(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
Expand Down Expand Up @@ -1335,6 +1357,8 @@ TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
TESTFIXTURE_FLAGS += -DSQLITE_STATIC_RANDOMJSON
TESTFIXTURE_FLAGS += -DSQLITE_STRICT_SUBTYPE=1

TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
TESTFIXTURE_SRC1 = sqlite3.c
Expand Down
15 changes: 12 additions & 3 deletions libsql-sqlite3/Makefile.msc
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@ TESTEXT = \
$(TOP)\ext\misc\percentile.c \
$(TOP)\ext\misc\prefixes.c \
$(TOP)\ext\misc\qpvtab.c \
$(TOP)\ext\misc\randomjson.c \
$(TOP)\ext\misc\regexp.c \
$(TOP)\ext\misc\remember.c \
$(TOP)\ext\misc\series.c \
Expand Down Expand Up @@ -1692,6 +1693,7 @@ SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_STRICT_SUBTYPE=1
!ENDIF

# <<mark>>
Expand Down Expand Up @@ -1728,6 +1730,8 @@ FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_MAX_MMAP_SIZE=0
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRINTF_PRECISION_LIMIT=1000
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRIVATE=""
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_STRICT_SUBTYPE=1
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_STATIC_RANDOMJSON

FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_MAX_MEMORY=50000000
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRINTF_PRECISION_LIMIT=1000
Expand All @@ -1744,6 +1748,7 @@ FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\fuzzinvariants.c
FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\vt02.c
FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\recover\dbdata.c
FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\recover\sqlite3recover.c
FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\misc\randomjson.c

OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
Expand Down Expand Up @@ -1823,8 +1828,8 @@ $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLIT
/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)

# <<mark>>
sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
$(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
sqldiff.exe: $(TOP)\tool\sqldiff.c $(TOP)\ext\consio\console_io.h $(TOP)\ext\consio\console_io.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
$(LTLINK) $(NO_WARN) -I$(TOP)\ext\consio $(TOP)\tool\sqldiff.c $(TOP)\ext\consio\console_io.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)

dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
$(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
Expand Down Expand Up @@ -2261,6 +2266,8 @@ keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
# Source files that go into making shell.c
SHELL_SRC = \
$(TOP)\src\shell.c.in \
$(TOP)\ext\consio\console_io.c \
$(TOP)\ext\consio\console_io.h \
$(TOP)\ext\misc\appendvfs.c \
$(TOP)\ext\misc\completion.c \
$(TOP)\ext\misc\base64.c \
Expand Down Expand Up @@ -2431,6 +2438,8 @@ TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CKSUMVFS_STATIC=1
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_STATIC_RANDOMJSON
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_STRICT_SUBTYPE=1

TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
Expand Down Expand Up @@ -2541,7 +2550,7 @@ smoketest: $(TESTPROGS)
shelltest: $(TESTPROGS)
.\testfixture.exe $(TOP)\test\permutations.test shell

sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(SQLITE_TCL_DEP)
sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(TOP)\ext\consio\console_io.h $(TOP)\ext\consio\console_io.c $(SQLITE_TCL_DEP)
$(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@

sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
Expand Down
2 changes: 1 addition & 1 deletion libsql-sqlite3/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.44.0
3.45.1
1 change: 1 addition & 0 deletions libsql-sqlite3/autoconf/Makefile.msc
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS=1
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_STRICT_SUBTYPE=1
!ENDIF


Expand Down
2 changes: 1 addition & 1 deletion libsql-sqlite3/autoconf/tea/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so that we create the export library with the dll.
#-----------------------------------------------------------------------

AC_INIT([sqlite],[3.44.0])
AC_INIT([sqlite],[3.45.1])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
Expand Down
26 changes: 13 additions & 13 deletions libsql-sqlite3/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for sqlite 3.44.0.
# Generated by GNU Autoconf 2.69 for sqlite 3.45.1.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
Expand Down Expand Up @@ -757,8 +757,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.44.0'
PACKAGE_STRING='sqlite 3.44.0'
PACKAGE_VERSION='3.45.1'
PACKAGE_STRING='sqlite 3.45.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1511,7 +1511,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sqlite 3.44.0 to adapt to many kinds of systems.
\`configure' configures sqlite 3.45.1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1577,7 +1577,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.44.0:";;
short | recursive ) echo "Configuration of sqlite 3.45.1:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1714,8 +1714,8 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.44.0
generated by GNU Autoconf 2.71
sqlite configure 3.45.1
generated by GNU Autoconf 2.69

Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
Expand Down Expand Up @@ -1989,8 +1989,8 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by sqlite $as_me 3.44.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
It was created by sqlite $as_me 3.45.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0$ac_configure_args_raw

Expand Down Expand Up @@ -13190,8 +13190,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sqlite $as_me 3.44.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
This file was extended by sqlite $as_me 3.45.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
Expand Down Expand Up @@ -13258,8 +13258,8 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
sqlite config.status 3.44.0
configured by $0, generated by GNU Autoconf 2.71,
sqlite config.status 3.45.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down
2 changes: 1 addition & 1 deletion libsql-sqlite3/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
# you don't need (for example BLT) by erasing or commenting out
# the corresponding code.
#
AC_INIT([sqlite],[m4_esyscmd(cat VERSION | tr -d '\n')])
AC_INIT([sqlite],m4_esyscmd(cat VERSION | tr -d '\n'))

dnl Make sure the local VERSION file matches this configure script
sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'`
Expand Down
14 changes: 13 additions & 1 deletion libsql-sqlite3/doc/compile-for-windows.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Notes On Compiling SQLite On Windows 11

Here are step-by-step instructions on how to build SQLite from
canonical source on a new Windows 11 PC, as of 2023-08-16:
canonical source on a new Windows 11 PC, as of 2023-11-01:

1. Install Microsoft Visual Studio. The free "community edition"
will work fine. Do a standard install for C++ development.
Expand Down Expand Up @@ -84,6 +84,18 @@ following minor changes:
<li> `set PATH=c:\tcl32\bin;%PATH%`
</ul>

## Building a DLL

The command the developers use for building the deliverable DLL on the
[download page](https://sqlite.org/download.html) is as follows:

> ~~~~
nmake /f Makefile.msc sqlite3.dll USE_NATIVE_LIBPATHS=1 "OPTS=-DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 -DSQLITE_ENABLE_SERIALIZE=1 -DSQLITE_ENABLE_MATH_FUNCTIONS=1"
~~~~

That command generates both the sqlite3.dll and sqlite3.def files. The same
command works for both 32-bit and 64-bit builds.

## Statically Linking The TCL Library

Some utility programs associated with SQLite need to be linked
Expand Down