diff --git a/executor/explainfor_test.go b/executor/explainfor_test.go index 54e49d194a22c..9a0c782a206c7 100644 --- a/executor/explainfor_test.go +++ b/executor/explainfor_test.go @@ -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) { diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 6b5085130e31e..d8835356e0f4c 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -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)