Upgrade to SQLite 3.51.2
Categories
(Core :: SQLite and Embedded Database Bindings, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: RyanVM, Assigned: mak)
References
(Regressed 1 open bug, )
Details
(Keywords: perf-alert)
Attachments
(3 external files)
Version 3.51.0 is a first major update to SQLite since the 25th anniversary release on 2025-05-29. Version 3.51.0 includes new features, new interfaces, and new optimizations.
SQLite Release 3.51.0 On 2025-11-04
- New macros in sqlite3.h:
- SQLITE_SCM_BRANCH β the name of the branch from which the source code is taken.
- SQLITE_SCM_TAGS β space-separated list of tags on the source code check-in.
- SQLITE_SCM_DATETIME β ISO-8601 date and time of the source code check-in.
- Two new JSON functions, jsonb_each() and jsonb_tree() work the same as the existing json_each() and json_tree() functions except that they return JSONB for the "value" column when the "type" is 'array' or 'object'.
- The carray and percentile extensions are now built into the amalgamation, though they are disabled by default and must be activated at compile-time using the -DSQLITE_ENABLE_CARRAY and/or -DSQLITE_ENABLE_PERCENTILE options, respectively.
- Enhancements to TCL Interface:
- Add the -asdict flag to the eval command to have it set the row data as a dict instead of an array.
- User-defined functions may now break to return an SQL NULL.
- CLI enhancements:
- Increase the precision of ".timer" to microseconds.
- Enhance the "box" and "column" formatting modes to deal with double-wide characters.
- The ".imposter" command provides read-only imposter tables that work with VACUUM and do not require the --unsafe-testing option.
- Add the --ifexists option to the CLI command-line option and to the .open command.
- Limit columns widths set by the ".width" command to 30,000 or less, as there is not good reason to have wider columns, but supporting wider columns provides opportunity to malefactors.
- Performance enhancements:
- Use fewer CPU cycles to commit a read transaction.
- Early detection of joins that return no rows due to one or more of the tables containing no rows.
- Avoid evaluation of scalar subqueries if the result of the subquery does not change the result of the overall expression.
- Faster window function queries when using "BETWEEN :x FOLLOWING AND :y FOLLOWING" with a large :y.
- Add the PRAGMA wal_checkpoint=NOOP; command and the SQLITE_CHECKPOINT_NOOP argument for sqlite3_wal_checkpoint_v2().
- Add the sqlite3_set_errmsg() API for use by extensions.
- Add the sqlite3_db_status64() API, which works just like the existing sqlite3_db_status() API except that it returns 64-bit results.
- Add the SQLITE_DBSTATUS_TEMPBUF_SPILL option to the sqlite3_db_status() and sqlite3_db_status64() interfaces.
- In the session extension add the sqlite3changeset_apply_v3() interface.
- For the built-in printf() and the format() SQL function, omit the leading '-' from negative floating point numbers if the '+' flag is omitted and the "#" flag is present and all displayed digits are '0'. Use '%#f' or similar to avoid outputs like '-0.00' and instead show just '0.00'.
- Improved error messages generated by FTS5.
- Enforce STRICT typing on computed columns.
- Improved support for VxWorks
- JavaScript/WASM now supports 64-bit WASM. The canonical builds continue to be 32-bit but creating one's own 64-bit build is now as simple as running "make".
- Improved resistance to database corruption caused by an application breaking Posix advisory locks using close().
| Reporter | ||
Comment 1•1 year ago
•
|
||
Looks like carray.c got a pretty significant overhaul in this release. Also, carray.h is missing from the prepackaged sources, causing ./mach vendor to break. Obviously I can remove the carray.h move-file action in moz.yaml, but it seems likely we're going to need more extensive changes than that. Can you please take a look, Marco?
| Reporter | ||
Comment 2•1 year ago
•
|
||
Ah, it looks like it was brought directly into the amalgamation now?
| Assignee | ||
Comment 3•1 year ago
|
||
yes, carray is in the amalgamation and must be enabled through a flag. We were already building it as a static extension, so this should be easier, but we need a few changes for the build.
I'll look into that.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
The carray extension is now part of the amalgamation.
| Assignee | ||
Comment 5•1 year ago
|
||
| Assignee | ||
Comment 6•1 year ago
|
||
| Assignee | ||
Comment 7•1 year ago
|
||
Still awaiting for results with the patches https://treeherder.mozilla.org/jobs?repo=try&revision=cc694d75e2c5bedd149b600fc4ede7abfdbc903b
Will update if necessary.
Comment 9•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6642f36a4b38
https://hg.mozilla.org/mozilla-central/rev/8345920662ea
https://hg.mozilla.org/mozilla-central/rev/352f9fb7219e
Comment 10•1 year ago
|
||
As mentioned at the end of https://bugzilla.mozilla.org/show_bug.cgi?id=1999921#c9 based on links provided by :janv and additional re-triggers to help confirm this before wpt14 for IndexedDB WPT on Android is fine but these after wpt14's are having a horrible horrible horrible day which seems to deterministically be the result of the upgrade.
This should be backed out and I'll ask sheriffs for help on that now in matrix.
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Backed out here: https://hg.mozilla.org/integration/autoland/rev/dfe8430bc2c923fef067a7a06a5174d67a39372b for causing multiple failures on Bug 1999921
Comment 13•1 year ago
|
||
(In reply to Cristina Horotan [:chorotan] from comment #12)
Backed out here: https://hg.mozilla.org/integration/autoland/rev/dfe8430bc2c923fef067a7a06a5174d67a39372b for causing multiple failures on Bug 1999921
Perfherder has detected a browsertime performance change from push dfe8430bc2c923fef067a7a06a5174d67a39372b.
No action is required from the author; this comment is provided for informational purposes only.
Regressions:
| Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
|---|---|---|---|---|---|
| 6% | idb-open-many-seq open_duration | windows11-64-24h2-shippable | fission webrender | 6,477.64 -> 6,850.67 | Before/After |
| 6% | idb-open-many-seq time_duration | windows11-64-24h2-shippable | fission webrender | 6,485.58 -> 6,858.38 | Before/After |
Need Help or Information?
If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
| Reporter | ||
Comment 14•1 year ago
|
||
Interesting. So I wonder if bug 2000865 is just pointing to a general IDB slowdown from this update exacerbated on slower platforms like Android.
Comment 15•1 year ago
|
||
It would be good to know whether there was actually a perf alert indicating an improvement after the upgrade, or perhaps we should wait a bit and see how the metric looks in the coming days or weeks.
Comment 16•1 year ago
|
||
But it could also be that the newer SQLite is faster in some cases. In any case, thatβs something we should probably investigate after the regressions are resolved?
| Reporter | ||
Comment 17•1 year ago
|
||
Oh right, the regression in comment 13 was on the backout (and the graph does show an improvement around the time it landed too).
| Assignee | ||
Comment 18•1 year ago
|
||
There's a few "Performance enhancements" in the update notes, that are likely to shift some of the timings.
There's not much to investigate out of the perf notifications we got, I mean it's nice to know this update may improve perf in some cases, and the backout shows they are real.
But we're still blocked on actual test failures in bug 2000865.
| Reporter | ||
Comment 19•1 year ago
|
||
Changes in this specific patch release, version 3.51.1 (2025-11-28)
- Fix incorrect results from nested EXISTS queries caused by the optimization in item 6b in the 3.51.0 release.
- Fix a latent bug in fts5vocab virtual table, exposed by new optimizations in the 3.51.0 release
No change in Try results. However, D271612 needs updating to address a newly-added linter check looking for unused includes:
TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/toolkit/xre/AutoSQLiteLifetime.cpp:X | /builds/worker/checkouts/gecko/toolkit/xre/AutoSQLiteLifetime.cpp includes DebugOnly.h but does not reference any of its API (includes)
Comment 20•10 months ago
|
||
Changes in this specific patch release, version 3.51.2 (2026-01-09):
- Fix an obscure deadlock in the new broken-posix-lock detection logic in item 17 above.
- Fix multiple problems in the EXISTS-to-JOIN optimization that was added as part of optimization item 6b above.
- Other minor bug fixes.
| Assignee | ||
Updated•9 months ago
|
Updated•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
| Assignee | ||
Comment 21•9 months ago
•
|
||
We're bringing on the discussion in Bug 2000865 for the idb failures.
| Assignee | ||
Comment 22•9 months ago
•
|
||
I'll try landing 3.51.2.
Try runs show the fixes in 3.51.2 solved the indexeddb issue.
I also pushed 3.51.1 to Try again to check if we had fixed something on our side in the meanwhile, and it still showed failures in idb tests.
Also Ryan made independent Try pushes and they didn't show any failures in idb tests.
PS: There may be a 3.51.3 shortly, though the fixes are not relevant to us
Comment 23•9 months ago
|
||
Comment 24•9 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/59d23eb8674a
https://hg.mozilla.org/mozilla-central/rev/44865d2066ca
https://hg.mozilla.org/mozilla-central/rev/0f1bdd59c39b
Updated•9 months ago
|
| Reporter | ||
Updated•8 months ago
|
| Reporter | ||
Updated•8 months ago
|
| Reporter | ||
Updated•8 months ago
|
| Reporter | ||
Updated•8 months ago
|
Description
•