SQLite 3.53.4 发布

发布于

SQLite 是一个 C 语言库,实现了一个小型、快速、独立、高可靠性、全功能的 SQL 数据库引擎。SQLite 是世界上使用最多的数据库引擎。SQLite 的源代码属于公共领域,每个人都可以免费使用,用于任何目的。

SQLite 3.53.4 现已发布,具体更新内容包括:

## 从版本 3.53.0 的主要变化

1. 修复 [WAL 重置数据库损坏漏洞](https://sqlite.org/wal.html#walresetbug)。
2. 添加[查询结果格式化程序 (QRF)](https://sqlite.org/src/file/ext/qrf) 库,以便在等距字体屏幕上格式化 SQL 查询结果,使其易于阅读。
1. 向 [TCL 接口](https://sqlite.org/tclsqlite.html) 添加 [format 方法](https://sqlite.org/tclsqlite.html#format),以便可以从 TCL 访问 QRF。
2. QRF 用于 [CLI](https://sqlite.org/cli.html) 中的结果格式化,从而提高显示功能。
3. SQL 语言新增特性:
1. 增强 [ALTER TABLE 语句](https://sqlite.org/lang_altertable.html),允许添加和删除 NOT NULL 和 CHECK 约束。
2. [REINDEX EXPRESSIONS](https://sqlite.org/lang_reindex.html) 语句用于重建表达式索引。(可用于修复 [过期的表达式索引](https://sqlite.org/staleexpridx.html)。)
3. [TEMP](https://sqlite.org/lang_createtrigger.html#temptrig) triggers 现在可以修改和 / 或查询主模式中的表。
4. 增强 [VACUUM INTO](https://sqlite.org/lang_vacuum.html#vacuuminto),当使用 URI 文件名作为目标,并且该文件名具有 reserve=N 查询参数(N 介于 0 和 255 之间),则生成的数据库副本的保留量设置为 N。
4. 新增 SQL 函数:
1. [json_array_insert()](https://sqlite.org/json1.html#jarrayins)
2. [jsonb_array_insert()](https://sqlite.org/json1.html#jarrayins)
5. [CLI](https://sqlite.org/cli.html) 的改进:
1. 对 .mode 命令进行了重大改进。
2. 由于新增了 QRF 扩展,结果格式得到了改进。例如,在表格输出模式下,数值现在默认右对齐。
3. 交互式 CLI 会话的默认输出模式现在使用 QRF 格式,以 Unicode 方框字符构成的方框形式显示查询结果,从而提高可读性。批量 CLI 会话为了兼容性,仍使用旧版输出格式。
4. [dot-commands](https://sqlite.org/cli.html#dotcmd) 末尾的裸分号(未加引号)会被忽略。← 可能存在不兼容问题!
5. 修复 .testcase 和 .check 命令,使其能够正常工作,并在源代码树中包含的标准 SQLite 测试套件的脚本中使用这些命令。
6. 命令行参数中与 *.sql 或 *.txt 匹配且为非空文件名的参数将被读取并解释为 SQL 语句和 / 或 [dot-commands](https://sqlite.org/cli.html#dotcmd) 的脚本。
7. 现在 “.timer” 命令的参数可以是 “once”,即仅在下一个 SQL 语句上运行计时器。
8. “.progress”dot-command 新增的 “--timeout S” 选项会使 SQL 语句在 S 秒后中断。
9. “.indexes” 命令已更改,现在 PATTERN 参数匹配索引名称,而不是被索引表的名称(从而使 PATTERN 参数真正发挥作用)。此外,“.indexes” 命令还添加了几个新选项。
6. 新的 C-language interfaces:
1. [sqlite3_str_truncate()](https://sqlite.org/c3ref/str_append.html)
2. [sqlite3_str_free()](https://sqlite.org/c3ref/str_finish.html)
3. [sqlite3_carray_bind_v2()](https://sqlite.org/c3ref/carray_bind.html)
4. 向 [sqlite3_prepare_v3()](https://sqlite.org/c3ref/prepare.html) 添加 [SQLITE_PREPARE_FROM_DDL](https://sqlite.org/c3ref/c_prepare_dont_log.html#sqlitepreparefromddl) 选项,允许 [虚拟表](https://sqlite.org/vtab.html) 实现安全地准备从数据库模式派生的 SQL 语句。
5. 添加了 [SQLITE_UTF8_ZT](https://sqlite.org/c3ref/sqliteutf8zt) 常量,可将其用作 [sqlite3_result_text64()](https://sqlite.org/c3ref/result_blob.html) 或 [sqlite3_bind_text64()](https://sqlite.org/c3ref/bind_blob.html) 的编码参数,以指示该值为 UTF-8 编码并以零结尾。
6. [SQLITE_LIMIT_PARSER_DEPTH](https://sqlite.org/c3ref/sqlitelimitparserdepth) 选项已添加到 [sqlite3_limit()](https://sqlite.org/c3ref/limit.html) 中。
7. [SQLITE_DBCONFIG_FP_DIGITS](https://sqlite.org/c3ref/db_config.html) 选项已添加到 [sqlite3_db_config()](https://sqlite.org/c3ref/db_config.html) 中。
7. Query planner 改进:
1. 对于 EXCEPT、INTERSECT 和 UNION,始终使用排序合并算法,因为这几乎总是比使用哈希表更快。
2. 改进 star schema 下大型多路连接的连接顺序选择。
3. 增强 EXISTS-to-JOIN 优化,使得插入的 JOIN 项不必位于最内层循环中,只要 EXISTS-to-JOIN 循环的所有依赖项都在外层循环中即可。
4. 增强 omit-noop-join 优化,使其能够省略不影响输出的连接链。
5. 允许使用 “GROUP BY e1 ORDER BY e2” 的查询,其中 e1 和 e2 除了 ASC/DESC 排序顺序不同之外完全相同,可以使用单个索引进行优化。
6. 允许虚拟表在查询结果集与 ORDER BY 子句不完全匹配的情况下优化 DISTINCT 语句。
8. [向会话扩展](https://sqlite.org/sessionintro.html) 添加新接口,允许应用程序将更改逐个添加到 sqlite3_changegroup 对象中:
1. [sqlite3changegroup_change_begin()](https://sqlite.org/session/sqlite3changegroup_change_begin.html)
2. [sqlite3changegroup_change_blob()](https://sqlite.org/session/sqlite3changegroup_change_blob.html)
3. [sqlite3changegroup_change_double()](https://sqlite.org/session/sqlite3changegroup_change_double.html)
4. [sqlite3changegroup_change_int64()](https://sqlite.org/session/sqlite3changegroup_change_int64.html)
5. [sqlite3changegroup_change_null()](https://sqlite.org/session/sqlite3changegroup_change_null.html)
6. [sqlite3changegroup_change_text()](https://sqlite.org/session/sqlite3changegroup_change_text.html)
7. [sqlite3changegroup_change_finish()](https://sqlite.org/session/sqlite3changegroup_change_finish.html)
8. [sqlite3changegroup_config()](https://sqlite.org/session/sqlite3changegroup_config.html)
9. 改进浮点数↔文本转换:
1. 重新实现以提高性能。
2. 现在默认四舍五入 [到 17 位有效数字](https://sqlite.org/floatingpoint.html#*fpdigits),而不是像之前所有版本那样保留 15 位。如果需要,可以使用 [sqlite3_db_config](https://sqlite.org/c3ref/db_config.html) ( [SQLITE_DBCONFIG_FP_DIGITS](https://sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigfpdigits) API(上文第 6g 项)更改此设置。
10. 添加了 [self-healing](https://sqlite.org/staleexpridx.html#selfheal) 功能,以解决 [过期表达式索引](https://sqlite.org/staleexpridx.html) 问题。
11. 向 [sqlite3_rsync](https://sqlite.org/rsync.html) 添加 “-p|--port” 选项。
12. 停止对 [Windows RT](https://en.wikipedia.org/wiki/Windows_RT) 的支持。
13. JavaScript/WASM 方面:
1. 新增 “opfs-wl” VFS,其功能与 “opfs” VFS 相同,但使用 Web Locks 进行锁定,因此比 “opfs” 自定义协议能提供更公平的 lock sharing。“opfs-wl” 需要使用 `<code>Atomics.waitAsync()</code>`,因此比 “opfs” 要求更高的浏览器版本。

## 本次特定补丁版本 3.53.4 的更改

1. 修复了 3.53.0 版本(以及 3.53.1、3.53.2 和 3.53.3 版本)中主要由 AI 引起的问题。 详情可参阅 [check-in timeline](https://sqlite.org/src/timeline?from=version-3.53.0&to=version-3.53.4&to2=branch-3.53&y=ci)。

**Hashes:**
- SQLITE_SOURCE_ID: 2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc
- SHA3-256 for sqlite3.c: 67f423e9ebbbdc473cbc4772c872ee6b89f31fde4ed0279a5c25d5f65c043a16

详情可查看: [https://sqlite.org/releaselog/3_53_4.html](https://sqlite.org/releaselog/3_53_4.html)

---

原文链接:[点击查看](https://www.oschina.net/news/480212/sqlite-3-53-4-released)

评论

暂无评论。