Skip to content

Commit

Permalink
stats: add logging to TestDefaultColumns to help debug flake
Browse files Browse the repository at this point in the history
This commit adds some logging to the TestDefaultColumns test in order
to help debug a test failure.

Informs #38572

Release note: None
Release justification: category 1, non-production code change
  • Loading branch information
rytaft committed Sep 24, 2019
1 parent 9fd4ce1 commit 0d1d9da
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/sql/stats/automatic_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,17 @@ func TestDefaultColumns(t *testing.T) {

sqlRun.Exec(t, `CREATE STATISTICS s FROM t.a`)

// TODO(rytaft): this extra logging was added to help debug issue #38572.
// Remove it once that issue is resolved.
// === BEGINNING OF EXTRA LOGGING ===
res := sqlRun.QueryStr(t, `SHOW CREATE TABLE t.a`)
t.Log(sqlutils.MatrixToStr(res))
res = sqlRun.QueryStr(t, `EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t.a`)
t.Log(sqlutils.MatrixToStr(res))
res = sqlRun.QueryStr(t, `SHOW STATISTICS FOR TABLE t.a`)
t.Log(sqlutils.MatrixToStr(res))
// === END OF EXTRA LOGGING ===

// There should be 101 stats. One for the primary index, plus 100 other
// columns.
sqlRun.CheckQueryResults(t,
Expand Down

0 comments on commit 0d1d9da

Please sign in to comment.