Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats: add logging to TestDefaultColumns to help debug flake #41037

Merged
merged 1 commit into from
Sep 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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