当前位置: 首页 > news >正文

SQLite 3.53.2 发布:修复漏洞、新增特性,多方面优化升级

SQLite:世界上使用最多的数据库引擎

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

SQLite 3.53.2 发布,更新内容丰富

SQLite 3.53.2 现已发布,具体更新内容如下:

1. 修复漏洞

修复 [WAL 重置数据库损坏漏洞](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fwal.html%23walresetbug)。

2. 添加查询结果格式化程序 (QRF) 库

添加[查询结果格式化程序 (QRF)](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsrc%2Ffile%2Fext%2Fqrf) 库,以便在等距字体屏幕上格式化 SQL 查询结果,使其易于阅读。

向 [TCL 接口](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Ftclsqlite.html)添加 [format 方法](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Ftclsqlite.html%23format),以便可以从 TCL 访问 QRF。QRF 用于 [CLI](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fcli.html) 中的结果格式化,从而提高显示功能。

3. SQL 语言新增特性

增强 [ALTER TABLE 语句](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Flang_altertable.html),允许添加和删除 NOT NULL 和 CHECK 约束。

[REINDEX EXPRESSIONS](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Flang_reindex.html) 语句用于重建表达式索引(可用于修复[过期的表达式索引](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fstaleexpridx.html))。

[TEMP](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Flang_createtrigger.html%23temptrig) [triggers](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Flang_createtrigger.html%23temptrig) 主体现在可以修改和 / 或查询主模式中的表。

增强 [VACUUM INTO](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Flang_vacuum.html%23vacuuminto),以便如果使用 URI 文件名作为目标,并且该文件名具有 reserve=N 查询参数(N 介于 0 和 255 之间),则生成的数据库副本的保留量设置为 N。

4. 新增 SQL 函数

[json_array_insert()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fjson1.html%23jarrayins);[jsonb_array_insert()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fjson1.html%23jarrayins)。

5. CLI 的改进

[对 .mode 命令](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fclimode.html)进行了重大改进。

由于新增了 QRF 扩展,结果格式得到了改进。例如,在表格输出模式下,数值现在默认右对齐。

交互式 CLI 会话的默认输出模式现在使用 QRF 格式,以 Unicode 方框字符构成的方框形式显示查询结果,从而提高可读性。批量 CLI 会话为了兼容性,仍使用旧版输出格式。

[dot-commands](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fcli.html%23dotcmd) 末尾的裸分号(未加引号)会被忽略(可能存在不兼容问题)。

修复 .testcase 和 .check 命令,使其能够正常工作,并在源代码树中包含的标准 SQLite 测试套件的脚本中使用这些命令。

命令行参数中与 *.sql 或 *.txt 匹配且为非空文件名的参数将被读取并解释为 SQL 语句和 / 或 [dot-commands](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fcli.html%23dotcmd) 的脚本。

现在 ".timer" 命令的参数可以是 "once",即仅在下一个 SQL 语句上运行计时器。

".progress"dot-command 新增的 "--timeout S" 选项会使 SQL 语句在 S 秒后中断。

".indexes" 命令已更改,现在 PATTERN 参数匹配索引名称,而不是被索引表的名称(从而使 PATTERN 参数真正发挥作用)。此外,".indexes" 命令还添加了几个新选项。

6. 新的 C-language interfaces

[sqlite3_str_truncate()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fstr_append.html);[sqlite3_str_free()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fstr_finish.html);[sqlite3_carray_bind_v2()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fcarray_bind.html)。

向 [sqlite3_prepare_v3()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fprepare.html) 添加 [SQLITE_PREPARE_FROM_DDL](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fc_prepare_dont_log.html%23sqlitepreparefromddl) 选项,允许[虚拟表](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fvtab.html)实现安全地准备从数据库模式派生的 SQL 语句。

添加了 [SQLITE_UTF8_ZT](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fc_any.html%23sqliteutf8zt) 常量,可将其用作 [sqlite3_result_text64()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fresult_blob.html) 或 [sqlite3_bind_text64()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fbind_blob.html) 的编码参数, 以指示该值为 UTF-8 编码并以零结尾。

[SQLITE_LIMIT_PARSER_DEPTH](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fc_limit_attached.html%23sqlitelimitparserdepth) 选项已添加到 [sqlite3_limit()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Flimit.html) 中。

[SQLITE_DBCONFIG_FP_DIGITS](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fc_dbconfig_defensive.html%23sqlitedbconfigfpdigits) 选项已添加到 [sqlite3_db_config() ](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fdb_config.html)中。

7. Query planner 改进

对于 EXCEPT、INTERSECT 和 UNION,始终使用排序合并算法,因为这几乎总是比使用哈希表更快。

改进 star schema 下大型多路连接的连接顺序选择。

增强 EXISTS-to-JOIN 优化,使得插入的 JOIN 项不必位于最内层循环中,只要 EXISTS-to-JOIN 循环的所有依赖项都在外层循环中即可。

增强 omit-noop-join 优化,使其能够省略不影响输出的连接链。

允许使用 "GROUP BY e1 ORDER BY e2" 的查询,其中 e1 和 e2 除了 ASC/DESC 排序顺序不同之外完全相同,可以使用单个索引进行优化。

允许虚拟表在查询结果集与 ORDER BY 子句不完全匹配的情况下优化 DISTINCT 语句。

8. 向会话扩展添加新接口

向[会话扩展](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsessionintro.html)添加新接口 ,允许应用程序将更改逐个添加到 sqlite3_changegroup 对象中:

[sqlite3changegroup_change_begin()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_begin.html);[sqlite3changegroup_change_blob()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_blob.html);[sqlite3changegroup_change_double()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_double.html);[sqlite3changegroup_change_int64()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_int64.html);[sqlite3changegroup_change_null()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_null.html);[sqlite3changegroup_change_text()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_text.html);[sqlite3changegroup_change_finish()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_change_finish.html);[sqlite3changegroup_config()](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fsession%2Fsqlite3changegroup_config.html)。

9. 改进浮点数↔文本转换

重新实现以提高性能。

现在默认四舍五入[到 17 位有效数字](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Ffloatingpoint.html%23*fpdigits),而不是像之前所有版本那样保留 15 位。如果需要,可以使用 [sqlite3_db_config](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fdb_config.html) ( [SQLITE_DBCONFIG_FP_DIGITS](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fc3ref%2Fc_dbconfig_defensive.html%23sqlitedbconfigfpdigits) ) API(上文第 6g 项)更改此设置。

10. 添加 self-healing 功能

添加了 [self-healing](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fstaleexpridx.html%23selfheal) 功能,以解决[过期表达式索引](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Fstaleexpridx.html)问题。

11. 向 sqlite3_rsync 添加选项

向[ sqlite3_rsync](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsqlite.org%2Frsync.html) 添加 "-p|--port" 选项。

12. 停止对 Windows RT 的支持

停止对 [Windows RT ](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWindows_RT)的支持。

13. JavaScript/WASM

新增 "opfs-wl" VFS,其功能与 "opfs" VFS 相同,但使用 Web Locks 进行锁定,因此比 "opfs" 自定义协议能提供更公平的 lock sharing。"opfs-wl" 需要使用 `Atomics.waitAsync()`,因此比 "opfs" 要求更高的浏览器版本。

14. 修复 3.53.0 版本问题

修复了用户报告的 3.53.0 版本中存在的问题。 详情可参阅 [check-in timeline](https://sqlite.org/src/timeline?from=version-3.53.0&to=version-3.53.2&to2=branch-3.53&y=ci)。

更多详情可查看 :。提醒大家关注 SQLite 3.53.2 的这些更新,以便更好地使用该数据库引擎。

http://www.jsqmd.com/news/978894/

相关文章:

  • WinUtil:Windows系统优化与软件管理的终极免费指南
  • 别再死记公式了!差分方程稳定性、特征根,用Python可视化一眼就看懂
  • 告别Slack依赖:实战Authelia OIDC打通Outline,打造私有化知识库的完整身份验证方案
  • 2026年干冰清洗设备可靠性评测:去除毛刺设备、小型干冰清洗机、干冰去毛刺机、干冰去毛刺设备、干冰模具清洗机、干冰清洗机多少钱选择指南 - 优质品牌商家
  • 别再只盯着JVM了:用JMX监控你的Tomcat连接池和业务Bean(附完整配置与避坑清单)
  • 别再硬转unsigned short了!FP16与Float互转的C语言实现详解与避坑
  • 2026年知名的大连电动采光通风天窗/大连采光排烟天窗主流厂家对比评测 - 行业平台推荐
  • 别再只用scatter3了!MATLAB三维数据可视化,plot3和scatter3的隐藏玩法与场景选择指南
  • 终极指南:OptiScaler如何让所有显卡都能享受DLSS级画质提升
  • 青海私人定制旅游:青海私人定制旅游、青海西宁旅行社、青甘大环线包车旅游、青甘大环线团队旅游定制、青甘大环线旅游向导选择指南 - 优质品牌商家
  • Next.js 前端开发:SSR/SSG 与治愈系 UI 组件库的设计实践
  • 【含四月底最新安装包】OpenClaw一键安装及使用教程
  • 告别Overleaf!在Windows上搭建本地LaTeX环境:VS Code + MiKTeX保姆级配置指南
  • 社区医院后台管理系统(SpringBoot+Java+MySQL,含完整可运行源码与数据库脚本)
  • Day5-微服务-RocketMQ具体项目的应用场景
  • 别再死记硬背Xception结构了!用TensorFlow 2.x手把手拆解它的‘深度可分离’核心
  • OpenWrt-Rpi网络优化终极指南:5步实现游戏零延迟体验
  • 2026年靠谱的非标管件/东台硅溶胶铸造管件优质供应商推荐 - 行业平台推荐
  • 5分钟上手Villus:Vue.js项目集成GraphQL的极速入门教程
  • 别再用13号引脚了!ESP32板载LED的正确打开方式(GPIO2详解)
  • 别再折腾源码编译了!Windows 10/11下5分钟搞定GDAL 3.x命令行环境(附Python绑定验证)
  • Pandas条件格式实战:用Styler让分析报告自动高亮关键数据
  • 你的第一个量化分析项目:从efinance抓取茅台股价到用Pandas做可视化分析
  • Matlab实现PO鹦鹉算法优化BP神经网络分类器(附4组实测数据+预测可视化)
  • 手把手教你:华为USG6000防火墙BootROM菜单的7个隐藏功能详解(含密码重置与版本回退)
  • 告别‘调参玄学’:手把手教你用Halcon的频域滤波搞定表面微小缺陷检测
  • 全新原装ADIS16505-2BMLZ 是一款高性能、工业级的MEMS(微机电系统)惯性测量单元(IMU),它将三轴陀螺仪和三轴加速度计集成于一体。
  • ESP32板载LED不亮?别慌,手把手教你用Arduino IDE搞定GPIO2闪烁(附Boot键下载避坑指南)
  • OpenWrt-Rpi QoS配置:优化网络流量与游戏体验的完整指南
  • 2026年热门的佛山物流折叠仓储笼/可堆叠折叠仓储笼/仓库用折叠仓储笼公司选择指南 - 品牌宣传支持者