# Fix One, Miss Another: Leveraging Historical Bug Fixes to Uncover Residual Bugs in Database Systems

DevFeed: [Fix One, Miss Another: Leveraging Historical Bug Fixes to Uncover Residual Bugs in Database Systems](<https://devfeed.tech/articles/fix-one-miss-another-leveraging-historical-bug-fixes-to-uncover-residual-bugs-in-database-systems-120821.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.07739>)

Author: Yankai Rong, Zhaoyang Zhang, Shuang Liu, Wei Lu, Xiaoyong Du

Published: 2026-11-06T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [bugfixes](<https://devfeed.tech/topics/bugfixes.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [CockroachDB](<https://devfeed.tech/topics/cockroachdb.md>), [MariaDB](<https://devfeed.tech/topics/mariadb.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [bug-fixes](<https://devfeed.tech/tags/bug-fixes.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [cockroachdb](<https://devfeed.tech/tags/cockroachdb.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [database](<https://devfeed.tech/tags/database.md>), [database-management](<https://devfeed.tech/tags/database-management.md>), [grammar](<https://devfeed.tech/tags/grammar.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [systems](<https://devfeed.tech/tags/systems.md>), [test](<https://devfeed.tech/tags/test.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

Reaper uses historical database bug fixes to find related defects in syntactic sibling handlers, which may share implementation patterns such as argument extraction, type checking, and permission validation. It infers a trigger profile and a validation profile from each fix, uses grammar-guided test mutation to exercise corresponding paths in sibling handlers, then applies staged validation to reduce false positives. Evaluated on MariaDB, MySQL, OceanBase, and CockroachDB, Reaper found 61 previously unknown bugs; developers confirmed 57, and 13 had been fixed at the time of writing.

## Source excerpt

arXiv:2611.07739v1 Announce Type: new Abstract: Database management systems (DBMSs) implement SQL constructs through grammar-driven dispatch handlers. Although handlers for syntactic siblings implement different SQL constructs, they often share a common implementation pattern, including argument extraction, type checking, and permission validation. Consequently, a bug fix that hardens the handler exercised by a historical bug may leave the corresponding logic in sibling handlers vulnerable to the same semantic flaw. We refer to such defects as sibling bugs. Despite the structural similarity among sibling handlers, existing bug-finding techniques rarely exploit historical fixes to systematically uncover these related defects. We present Reaper, a novel approach for detecting sibling bugs guided by historical bug fixes. Reaper first analyzes a bug fix to infer a trigger profile, which characterizes the conditions under which the defect is exposed, and a validation profile, which captures the semantic evidence needed to distinguish buggy behavior from correct behavior. It then projects the trigger profile onto syntactic siblings through grammar-guided test mutation, generating tests that exercise corresponding semantic paths in sibling handlers. Finally, Reaper validates suspicious behaviors using the inferred validation profile through a staged validation process, reducing false positives caused by complex DBMS behavior. We evaluate Reaper on four widely used DBMSs, including MariaDB, MySQL, OceanBase, and CockroachDB. Reaper uncovers 61 previously unknown bugs, of which 57 have been confirmed by developers and 13 have been fixed at the time of writing. These results demonstrate that historical bug fixes contain actionable semantic knowledge that can be systematically transferred across syntactic siblings to uncover otherwise overlooked defects.