File tree Expand file tree Collapse file tree 4 files changed +14
-10
lines changed
ui/packages/tidb-dashboard-lib/src/apps Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ func (s *Service) getDetails(c *gin.Context) {
109
109
// See: https://github.com/pingcap/tidb-dashboard/issues/1515
110
110
if result .BinaryPlan != "" {
111
111
// may failed but it's ok
112
- result .BinaryPlanText , _ = utils .GenerateBinaryPlanText (db , result .BinaryPlan )
112
+ result .BinaryPlanText , err = utils .GenerateBinaryPlanText (db , result .BinaryPlan )
113
113
// may failed but it's ok
114
114
result .BinaryPlanJSON , _ = utils .GenerateBinaryPlanJSON (result .BinaryPlan )
115
115
116
- // reduce response size
117
- result .BinaryPlan = ""
118
- result .Plan = ""
116
+ if err == nil {
117
+ // reduce response size
118
+ result .BinaryPlan = ""
119
+ result .Plan = ""
120
+ }
119
121
}
120
122
121
123
c .JSON (http .StatusOK , * result )
Original file line number Diff line number Diff line change @@ -237,13 +237,15 @@ func (s *Service) planDetailHandler(c *gin.Context) {
237
237
238
238
if result .AggBinaryPlan != "" {
239
239
// may failed but it's ok
240
- result .BinaryPlanText , _ = utils .GenerateBinaryPlanText (db , result .AggBinaryPlan )
240
+ result .BinaryPlanText , err = utils .GenerateBinaryPlanText (db , result .AggBinaryPlan )
241
241
// may failed but it's ok
242
242
result .BinaryPlanJSON , _ = utils .GenerateBinaryPlanJSON (result .AggBinaryPlan )
243
243
244
- // reduce response size
245
- result .AggBinaryPlan = ""
246
- result .AggPlan = ""
244
+ if err == nil {
245
+ // reduce response size
246
+ result .AggBinaryPlan = ""
247
+ result .AggPlan = ""
248
+ }
247
249
}
248
250
249
251
c .JSON (http .StatusOK , result )
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ function DetailPage() {
170
170
)
171
171
} ) ( ) }
172
172
</ Descriptions >
173
- { ( binaryPlanObj || ! ! data . plan ) && (
173
+ { ( ! ! data . binary_plan_text || ! ! data . plan ) && (
174
174
< >
175
175
< Space size = "middle" style = { { color : '#8c8c8c' } } >
176
176
{ t ( 'slow_query.detail.plan.title' ) }
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ function PlanDetail({ query }: IPlanDetailProps) {
175
175
) : null }
176
176
</ Descriptions >
177
177
178
- { ( binaryPlanObj || ! ! data . plan ) && (
178
+ { ( ! ! data . binary_plan_text || ! ! data . plan ) && (
179
179
< >
180
180
< Space size = "middle" style = { { color : '#8c8c8c' } } >
181
181
{ t ( 'statement.pages.detail.desc.plans.execution.title' ) }
You can’t perform that action at this time.
0 commit comments