Conformance Testing of Relational DBMS Against SQL Specifications

📅 2024-06-13
🏛️ arXiv.org
📈 Citations: 1
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of verifying relational database management systems’ (RDBMS) compliance with SQL semantics at the standard specification level. We present the first executable Prolog reference implementation grounded in the complete formal SQL semantics defined by ISO/IEC 9075, integrated with differential fuzz testing for semantic-level black-box validation. Unlike prior approaches relying solely on crash detection or meta-transformation, our method enables end-to-end verifiable modeling of SQL standard semantics. Empirical evaluation across MySQL, TiDB, SQLite, and DuckDB uncovered 19 previously unknown vulnerabilities and 11 semantic inconsistencies—each traceable to explicit violations, omissions, or ambiguities in the SQL standard. Our approach significantly enhances the decidability and interpretability of SQL implementation correctness.

Technology Category

Application Category

📝 Abstract
A Relational Database Management System (RDBMS) is one of the fundamental software that supports a wide range of applications, making it critical to identify bugs within these systems. There has been active research on testing RDBMS, most of which employ crash or use metamorphic relations as the oracle. Although existing approaches can detect bugs in RDBMS, they are far from comprehensively evaluating the RDBMS's correctness (i.e., with respect to the semantics of SQL). In this work, we propose a method to test the semantic conformance of RDBMS i.e., whether its behavior respects the intended semantics of SQL. Specifically, we have formally defined the semantics of SQL and implemented them in Prolog. Then, the Prolog implementation serves as the reference RDBMS, enabling differential testing on existing RDBMS. We applied our approach to four widely-used and thoroughly tested RDBMSs, i.e., MySQL, TiDB, SQLite, and DuckDB. In total, our approach uncovered 19 bugs and 11 inconsistencies, which are all related to violating the SQL specification or missing/unclear specification, thereby demonstrating the effectiveness and applicability of our approach.
Problem

Research questions and friction points this paper is trying to address.

Testing RDBMS semantic conformance to SQL specifications
Formally defining SQL semantics for reference implementation
Detecting bugs and inconsistencies in major RDBMS systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

Formally defined SQL semantics in Prolog
Used Prolog as reference for differential testing
Uncovered bugs via SQL specification violations
🔎 Similar Papers
No similar papers found.
S
Shuang Liu
School of Information, Renmin University of China, Beijing, China.
C
Chenglin Tian
the College of Intelligence and Computing, Tianjin University, Tianjin, China.
J
Jun Sun
Singapore Management University, Singapore, Singapore.
R
Ruifeng Wang
the College of Intelligence and Computing, Tianjin University, Tianjin, China.
W
Wei Lu
School of Information, Renmin University of China, Beijing, China.
Y
Yongxin Zhao
East China Normal University, Shanghai, China.
Yinxing Xue
Yinxing Xue
Research Professor, Chinese Academy of Sciences
Software EngineeringSoftware SecurityProgram AnalysisSearch Based Software Engineering
J
Junjie Wang
the College of Intelligence and Computing, Tianjin University, Tianjin, China.
X
Xiaoyong Du
School of Information, Renmin University of China, Beijing, China.