Skip to content

Commit

Permalink
planner: fix the explain verbose to be NOT case insensitive (pingca…
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid authored May 9, 2022
1 parent b1379a6 commit 9f15cac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions executor/explainfor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func TestExplainForVerbose(t *testing.T) {
require.Equal(t, rs2[i][j], rs[i][j])
}
}
tk.MustQuery("explain format = 'verbose' select * from t1").Rows()
tk.MustQuery("explain format = 'VERBOSE' select * from t1").Rows()
tk.MustQuery("explain analyze format = 'verbose' select * from t1").Rows()
tk.MustQuery("explain analyze format = 'VERBOSE' select * from t1").Rows()
}

func TestIssue11124(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions planner/core/common_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,14 +1504,14 @@ func (e *Explain) prepareOperatorInfo(p Plan, taskType, driverSide, indent strin
var row []string
if e.Analyze || e.RuntimeStatsColl != nil {
row = []string{id, estRows}
if e.Format == types.ExplainFormatVerbose {
if strings.ToLower(e.Format) == types.ExplainFormatVerbose {
row = append(row, estCost)
}
actRows, analyzeInfo, memoryInfo, diskInfo := getRuntimeInfo(e.ctx, p, e.RuntimeStatsColl)
row = append(row, actRows, taskType, accessObject, analyzeInfo, operatorInfo, memoryInfo, diskInfo)
} else {
row = []string{id, estRows}
if e.Format == types.ExplainFormatVerbose {
if strings.ToLower(e.Format) == types.ExplainFormatVerbose {
row = append(row, estCost)
}
row = append(row, taskType, accessObject, operatorInfo)
Expand Down

0 comments on commit 9f15cac

Please sign in to comment.