Lune

EuroSys2025顶会

Understanding and Detecting SQL Function Bugs: Using Simple Boundary Arguments to Trigger Hundreds of DBMS Bugs

Jingzhou Fu, Jie Liang, Zhiyong Wu, Yanyang Zhao, Shanshan Li, Yu Jiang

摘要

Built-in SQL functions are crucial in Database Management Systems (DBMSs), supporting various operations and computations across multiple data types. They are essential for querying, data transformation, and aggregation. Despite their importance, the bugs in SQL functions have caused widespread problems in the real world, from system failures to arbitrary code execution. However, the understanding of the bug characteristics is limited. More importantly, conventional function testing methods struggle to generate semantically correct SQL test cases, while DBMS testing efforts are hard to measure built-in SQL functions.

This paper presents a comprehensive study of 318 built-in SQL function bugs, shedding light on their characteristics and root causes. Our investigation reveals that 87.4% of these bugs were caused by improper handling of boundary values of arguments. The boundary values of arguments come from three sources: literal values, type castings, and nested functions. By studying the bugs from three sources, we summarized 10 SQL patterns of bug-inducing queries. Moreover, we designed Soft, a testing tool based on the patterns to test seven widely used DBMSs, including PostgreSQL, MySQL, and ClickHouse. Soft discovered and confirmed 132 previously unknown SQL function bugs. The DBMS vendors took these bugs seriously and fixed 97 bugs in three days. For example, the CTO of ClickHouse commented on one bug: "We must fix it immediately or get rid of this function."

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • QSYM : A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing 引用了 Angora: Efficient Fuzzing by Principled Search
  • VDBFuzz: Understanding and Detecting Crash Bugs in Vector Database Management Systems 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • VDBFuzz: Understanding and Detecting Crash Bugs in Vector Database Management Systems 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Finding bugs in database systems via query partitioning
  • Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Finding bugs in database systems via query partitioning 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Finding bugs in database systems via query partitioning 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 Testing Database Engines via Pivoted Query Synthesis
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State VerificationZhiyong Wu, Jie Liang, Jingzhou Fu, Wenqian Deng 等SOSP 2025 · 1 次引用
  2. VDBFuzz: Understanding and Detecting Crash Bugs in Vector Database Management SystemsShenao Wang, Zhao Liu, Yanjie Zhao, Quanchen Zou 等ICSE 2026

它引用的 Paper20

  1. Angora: Efficient Fuzzing by Principled SearchPeng Chen, Hao ChenS&P 2018 · 616 次引用
  2. QSYM : A Practical Concolic Execution Engine Tailored for Hybrid FuzzingInsu Yun, Sangho Lee, Meng Xu, Yeongjin Jang 等USENIX Security 2018 · 537 次引用
  3. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 次引用
  4. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
  5. Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 次引用

相关 Paper

  1. Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent TransformationJie Liang, Zhiyong Wu, Jingzhou Fu, Mingzhe Wang 等ICSE 2024 · 18 次引用
  2. Understanding Transaction Bugs in Database SystemsZiyu Cui, Wensheng Dou, Yu Gao, Dong Wang 等ICSE 2024 · 9 次引用
  3. DynSQL: Stateful Fuzzing for Database Management Systems with Complex and Valid SQL Query GenerationZu-Ming Jiang, Jia-Ju Bai, Zhendong SuUSENIX Security 2023
  4. Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 次引用
  5. Efficiently Detecting DBMS Bugs through Bottom-up Syntax-based SQL GenerationYu Liang, Peng LiuNDSS 2026
黄昏的海面,两侧是细线勾勒的悬崖