Skip to content

Commit 6fa6ea4

Browse files
committed
stmtdiagnostics: de-flake TestDiagnosticsRequest
"plan-gist matching/anti-match" test case needs to have a query that has different plans depending on the values of the placeholders. With the recent bump of the default value of `optimizer_min_row_count` to 1 what used to be two different plans (scan + lookup join vs two scans + merge join) became effectively the same (two scans + merge join), resulting in a rare flake. This is now fixed by reseting the session variable to the old value for the test. Release note: None
1 parent 3824cc2 commit 6fa6ea4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/sql/stmtdiagnostics/statement_diagnostics_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ func TestDiagnosticsRequest(t *testing.T) {
481481
runner.Exec(t, "INSERT INTO large VALUES (1);")
482482
runner.Exec(t, "INSERT INTO large SELECT 2 FROM generate_series(1, 100);")
483483
runner.Exec(t, "ANALYZE large;")
484+
runner.Exec(t, "SET optimizer_min_row_count = 0;")
484485

485486
// query1 results in scan + lookup join whereas query2 does two scans +
486-
// merge join.
487+
// merge join (after adjusting optimizer_min_row_count).
487488
const (
488489
fprint = `SELECT v FROM small INNER JOIN large ON (k = v) AND (k = _)`
489490
query1 = "SELECT v FROM small INNER JOIN large ON k = v AND k = 0;"

0 commit comments

Comments
 (0)