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 #88037

Release note: None
  • Loading branch information
DrewKimball committed Sep 21, 2022
1 parent bbcb10f commit 0858f7c
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)
explainStmt := "EXPLAIN " + stmt
_, err = conn.Exec(explainStmt)
if err == nil {
logStmt(explainStmt)
}
}
done <- err
}(ctx)
Expand Down

0 comments on commit 0858f7c

Please sign in to comment.