Detecting Optimization Bugs in Database Engines via Non-Optimizing Reference Engine Construction

07/16/2020
by   Manuel Rigger, et al.
0

Database Management Systems (DBMS) are used ubiquitously. To efficiently access data, they apply sophisticated optimizations. Incorrect optimizations can result in logic bugs, which cause a query to compute an incorrect result set. We propose Non-Optimizing Reference Engine Construction (NoREC), a fully-automatic approach to detect optimization bugs in DBMS. Conceptually, this approach aims to evaluate a query by an optimizing and a non-optimizing version of a DBMS, to then detect differences in their returned result set, which would indicate a bug in the DBMS. Obtaining a non-optimizing version of a DBMS is challenging, because DBMS typically provide limited control over optimizations. Our core insight is that a given, potentially randomly-generated optimized query can be rewritten to one that the DBMS cannot optimize. Evaluating this unoptimized query effectively corresponds to a non-optimizing reference engine executing the original query. We evaluated NoREC in an extensive testing campaign on four widely-used DBMS, namely PostgreSQL, MariaDB, SQLite, and CockroachDB. We found 159 previously unknown bugs in the latest versions of these systems, 141 of which have been fixed by the developers. Of these, 51 were optimization bugs, while the remaining were error and crash bugs. Our results suggest that NoREC is effective, general and requires little implementation effort, which makes the technique widely applicable in practice.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/13/2020

Testing Database Engines via Pivoted Query Synthesis

Relational databases are used ubiquitously. They are managed by database...
research
06/17/2022

GDsmith: Detecting Bugs in Graph Database Engines

Graph database engines stand out in the era of big data for their effici...
research
05/20/2021

Testing DBMS Performance with Mutations

Because database systems are the critical component of modern data-inten...
research
05/06/2019

Characterizing and Detecting CUDA Program Bugs

While CUDA has become a major parallel computing platform and programmin...
research
06/01/2023

Finding Performance Issues in Database Engines via Cardinality Estimation Testing

Database Management Systems (DBMSs) process a given query by creating an...
research
11/04/2019

Improved Recognition of Security Bugs via Dual Hyperparameter Optimization

Background: Security bugs need to be handled by small groups of engineer...
research
06/14/2023

A statistical approach for finding property-access errors

We study the problem of finding incorrect property accesses in JavaScrip...

Please sign up or login with your details

Forgot password? Click here to reset