Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction
Jiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao, Quanqing Xu, Ziyu Cui, Xudong Xie, Hongtao Zhou, Jiaying Zhou, Jun Wei, Wei Wang
Abstract
Relational Database Management Systems (DBMSs) serve as foundational systems for data storage and management, supporting a rich variety of data types to specify storage formats and value ranges. These data types play a critical role in both data storage and computation. However, complex data computation operations (e.g., explicit and implicit data type conversions) can introduce data-type-related logic bugs (TypeBugs for brevity). Specifically, TypeBugs can cause SELECT statements to return incorrect query results, which can easily be overlooked by DBMS developers. Unfortunately, existing DBMS testing approaches do not examine data type conversions, rendering them ineffective at detecting TypeBugs.
We observe that database columns with different data types (e.g., INT and BIGINT) can store identical data values within specific value ranges, and executing identical SQL operations on these database columns should produce consistent results. Inspired by this observation, we propose TypeCheck, a novel testing approach for effectively detecting TypeBugs in relational DBMSs. We first identify storage-compatible data types T that can preserve identical data values and operation-oriented type compatibility rules opRules that define SQL operations producing consistent results when applied to different data types. Using T and opRules , we construct type-compatible databases and execute identical type-compatible SELECT statements on them. When these SELECT statements yield divergent execution results, we detect a TypeBug. We evaluate TypeCheck on six widely used relational DBMSs, and have detected 37 TypeBugs, of which 34 have been confirmed as previously unknown bugs.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4a95547f-ec48-43a7-9c9a-bbe7af531189Builds on33
- Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
- Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
- Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 citations
- APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database SystemsJinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim et al.VLDB 2020 · 77 citations
- Griffin : Grammar-Free DBMS FuzzingJingzhou Fu, Jie Liang, Zhiyong Wu, Mingzhe Wang et al.ASE 2022 · 44 citations
Related papers
- Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao et al.VLDB 2025 · 6 citations
- Detecting Logic Bugs in DBMSs via Equivalent Data ConstructionWenqian Deng, Jie Liang, Zhiyong Wu, Jingzhou Fu et al.SIGMOD 2026 · 1 citation
- Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai et al.ICSE 2023 · 26 citations
- Detecting Transactional Bugs in Database Engines via Graph-Based Oracle ConstructionZu-Ming Jiang, Si Liu, Manuel Rigger, Zhendong SuOSDI 2023 · 28 citations
- Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database SystemsZiyu Cui, Wensheng Dou, Yu Gao, Rui Yang et al.VLDB 2025 · 4 citations
