Skip to content

Commit

Permalink
opt: run sqlsmith roachtest queries with EXPLAIN
Browse files Browse the repository at this point in the history
This commit modifies the SqlSmith roachtest to run each generated query
with explain. This should allow the test to catch planning errors that
do not happen during normal execution.

Informs cockroachdb#88037

Release note: None
  • Loading branch information
DrewKimball committed Sep 21, 2022
1 parent bbcb10f commit 3e23a24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cmd/roachtest/tests/sqlsmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ INSERT INTO seed_mr_table DEFAULT VALUES;`, regionList[0]),
_, err := conn.Exec(stmt)
if err == nil {
logStmt(stmt)
stmt = "EXPLAIN " + stmt
_, err = conn.Exec(stmt)
if err == nil {
logStmt(stmt)
}
}
done <- err
}(ctx)
Expand Down

0 comments on commit 3e23a24

Please sign in to comment.