Detecting DBMS Bugs by Constructing Equivalent Representations of Intermediate Query Results
Xiaoxu Niu, Gong Chen, Jinfu Chen, Xiaoyuan Xie
Abstract
Database Management Systems (DBMSs) support multiple SQL mechanisms for representing intermediate query results, including VIEWs, Common Table Expressions (CTEs), and Temporary Tables (TEMPTs). When these mechanisms are used to represent the same intermediate query result, the corresponding queries are expected to produce consistent results. However, we observe that such queries can return inconsistent results, indicating potential DBMS logic bugs. Existing approaches for detecting DBMS logic bugs have never explored result consistency across such equivalent representations. In this paper, we propose ERIQ, a novel testing approach for detecting DBMS logic bugs from the perspective of checking result consistency across Equivalent Representations of Intermediate Query Results. ERIQ constructs SQL variants using a VIEW, a CTE, or a TEMPT to represent the same intermediate query result, executes these variants, and compares their returned results. We evaluated ERIQ on four widely used open-source DBMSs: MySQL, MariaDB, Percona, and OceanBase. In total, ERIQ detected 64 bugs, 63 of which were confirmed by developers, and two have been fixed. Among the confirmed bugs, 54 were unique and previously unknown logic bugs, and one was a documentation issue.
Create a lesson
Related papers
ELASTIC: Trajectory-Based Synchronization of Event and Tracking Data in Soccer
Hyunsung Kim, Hoyoung Choi, Kunhee Lee et al.
Demystifying and Improving Lazy Promotion in Cache Eviction
Qinghan Chen, Muhammad Haekal Muhyidin Al-Araby, Ziyue Qiu et al.
Diachronic Hypergraphs for Orchestrated Multi-Agent Multimodal Memory Curation
Yichao Feng, Ran Zhang, Haoran Luo et al.
RENSA: Rich Environment Metadata to Navigate Shared and Distributed Endpoints for Automated Federated SPARQL Query Generation
Victor Eiti Yamamoto, Takeda Hideaki, Yamamoto Yasunori
Engaging the scientific community in high-quality biocuration: a report on the International Society for Biocuration workshop, 'Maximizing community curation for the benefit of all'
Daniela Raciti, Susan L. M. Coort, Christian Grove et al.
No Silver Bullet: Boosting GaussDB Performance on the 30TB TPC-H Workload
Tim Zeyl, Jason Lam, Shu Lin et al.