SRS: Detecting Logic Bugs of Join Implementation in DBMSs via Set Relation Synthesis
J Q Lai, C. Zhang, B. Li, Chaoxiang Liang, Jie Liang, Zhiyong Wu, Jingzhou Fu, Yu Jiang,
Nanchang University · Tsinghua University
Key points
From the paper's conclusion- Among these, 33 are logic bugs, demonstrating SRS's effectiveness and practicality in detecting logic bugs in the implementation of join operations within DBMSs.
Abstract
Logic bugs can cause DBMSs to silently produce incorrect results for a given query, posing significant threats to software reliability and remaining challenging to detect. Join is a fundamental operation in DBMSs, enabling the combination of data from multiple tables; however, due to its complexity, it is also susceptible to logic bugs. Existing works detect logic bugs in join optimizations by altering query hints and system variables to alter the optimizer's choice of execution plans. However, these approaches struggle to detect logic bugs when query hints or system variables fail to influence the optimizer's behavior, or when the logic bugs reside in join implementation code that is unrelated to optimization. In this paper, we present S et R elation S ynthesis (SRS), a black-box testing approach that detects logic bugs of join implementation in DBMSs by leveraging set relations among different join operations. SRS applies transformations to the original join queries, including modifications to join types, join orders, and join conditions, while ensuring that the outputs of both the original and transformed queries preserve the expected set relations. Violations of these set relations indicate potential logic bugs. We realized SRS and evaluated it on five widely-used and extensively-tested DBMSs: MySQL, MariaDB, TiDB, PostgreSQL, and DuckDB. SRS uncovered 33 previously unknown and unique bugs, all of which have been confirmed, with 12 already fixed. Among these, 33 are logic bugs, demonstrating SRS's effectiveness and practicality in detecting logic bugs in the implementation of join operations within DBMSs.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Fix One, Miss Another: Leveraging Historical Bug Fixes to Uncover Residual Bugs in Database SystemsarXiv · 2026
- EPSC: Testing Database Management Systems via Equivalent Prepared Statement ConstructionProceedings of the ACM on Management of Data · 2026
- DBugScribe: Automatic Database Bug Reproduction from Community ReportsProceedings of the ACM on Management of Data · 2026
- SmartFuzz: Leveraging Large Language Models and Feature Composition to Generate High-Quality Seeds for Database FuzzingProceedings of the ACM on Programming Languages · 2026
- Logos: Certified Order-Sensitive SQL Rewrites with Mechanized Semantics and LLM GuidancearXiv · 2026
- Bound to be Complete: Efficient Verification for SQL Equivalence via U-ExpressionsarXiv · 2026