From 0858f7cf34c66828debf4dd49a9c65d6b9290f52 Mon Sep 17 00:00:00 2001 From: DrewKimball Date: Wed, 21 Sep 2022 03:07:39 -0700 Subject: [PATCH] opt: run sqlsmith roachtest queries with EXPLAIN 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 --- pkg/cmd/roachtest/tests/sqlsmith.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cmd/roachtest/tests/sqlsmith.go b/pkg/cmd/roachtest/tests/sqlsmith.go index a21fb9876b14..b65c8ff09d37 100644 --- a/pkg/cmd/roachtest/tests/sqlsmith.go +++ b/pkg/cmd/roachtest/tests/sqlsmith.go @@ -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)