Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction

vldb26-3022 · Regular Research · 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 implement and evaluate TypeCheck on six widely-used relational DBMSs, and have detected 37 typeBugs, of which 34 have been confirmed as previously unknown bugs, with 10 of these confirmed bugs already fixed.

Assigned reviewers

No reviewers assigned yet.

Candidates from the panel ranked by taxonomy affinity

#ReviewerMatchLoadWhy