Skip to content
Open access

MimicDB: Runtime Defense against Wrong-Result Bugs in Database Query Optimizers via Query-Rewriting Diversity

Sep 2026 · Security and Safety · 0 citations

Abstract

Wrong-result bugs undermine database reliability by allowing queries to com- plete successfully while silently returning incorrect data. Cross-product diversity can help expose these failures, but requires replicated state and compatibility across database sys- tems. MimicDB explores an alternative: selective query protection through diversity within a single database instance. It combines DQP-, CODD-, and TLP-inspired execution bod- ies with shared-snapshot reads and result adjudication, enabling diverse executions to be compared over a consistent database state. We evaluate MimicDB on eight TPC-H-derived queries and one custom query. In diagnostic fault-injection experiments, the fully heteroge- neous configuration (C4) detects 74.2% and 82.8% of triggered plan-conditioned corruptions at scale factors 1 and 10, respectively. Reference-priority adjudication (policy D) increases correct-result selection from 21.0% to 45.2% at SF1 and from 31.2% to 54.7% at SF10, rela- tive to strict majority. Reference-corruption tests demonstrate the dependence of these gains on reference validity and reveal the availability cost of abstaining on conflicting results. A separate online evaluation uses strict-majority adjudication (policy M). At SF1, synchronous C4 achieves 7.0–13.4% of the throughput of a single-execution gateway baseline across the tested concurrency levels. Asynchronous execution returns the original query result before validation while retaining the background validation work. Shared-snapshot reads eliminate observed state-induced disagreement across 240 concurrent-write rounds, while historical cases illustrate targeted bypasses. These findings characterize the potential of single-engine diversity to detect wrong-result failures and select correct results, together with the execution costs and reference-validity constraints that shape its practical use.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.