Skip to content

Commit

Permalink
fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo committed Dec 23, 2022
1 parent d1a3762 commit e3c8b11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,9 @@ func doBootstrapSQLFile(s Session) {
if rs != nil {
// I don't believe we need to drain the result-set in bootstrap mode
// but if required we can do this here in future.
rs.Close()
if err := rs.Close(); err != nil {
logutil.BgLogger().Fatal("unable to close result", zap.Error(err))
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions session/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,14 +1080,16 @@ func TestInitializeSQLFile(t *testing.T) {
defer dom.Close()
se := createSessionAndSetID(t, store)
ctx := context.Background()
r := mustExec(t, se, `SHOW VARIABLES LIKE 'query_cache_type'`)
r, err := exec(se, `SHOW VARIABLES LIKE 'query_cache_type'`)
require.NoError(t, err)
req := r.NewChunk(nil)
err = r.Next(ctx, req)
require.NoError(t, err)
require.Equal(t, 0, req.NumRows()) // not shown in noopvariables mode
require.NoError(t, r.Close())

r = mustExec(t, se, `SHOW VARIABLES LIKE 'tidb_enable_noop_variables'`)
r, err = exec(se, `SHOW VARIABLES LIKE 'tidb_enable_noop_variables'`)
require.NoError(t, err)
req = r.NewChunk(nil)
err = r.Next(ctx, req)
require.NoError(t, err)
Expand Down

0 comments on commit e3c8b11

Please sign in to comment.