Skip to content

SQLreduce: Reduce verbose SQL queries to minimal examples

Latest
Compare
Choose a tag to compare
@df7cb df7cb released this 07 Mar 09:40
· 16 commits to master since this release
v1.0

SQLsmith has proven to be an effective
tool for finding bugs in different areas in the PostgreSQL server and other
products, including security bugs, ranging from executor bugs to segfaults in
type and index method implementations.

However, the random queries generated by SQLsmith that trigger some error are
most often very large and contain a lot of noise that does not contribute to
the error. So far, manual inspection of the query and tedious editing was
required to reduce the example to a minimal reproducer that developers can use
to fix the problem.

This issue is solved by SQLreduce. SQLreduce takes as input an arbitrary SQL
query which is then run against a PostgreSQL server. Various simplification
steps are applied, checking after each step that the simplified query still
triggers the same error from PostgreSQL. The end result is a SQL query with
minimal complexity.

SQLreduce is effective at reducing the queries from
original error reports from SQLsmith
to queries that match manually-reduced queries.

More details on how it works in the documentation.