Skip to content

Commit

Permalink
executor: better error message for ADMIN CHECK INDEX (#38298)
Browse files Browse the repository at this point in the history
close #37323
  • Loading branch information
taofengliu authored Oct 11, 2022
1 parent 6c7a236 commit 6a9da0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (b *executorBuilder) buildRecoverIndex(v *plannercore.RecoverIndex) Executo
idxName := strings.ToLower(v.IndexName)
index := tables.GetWritableIndexByName(idxName, t)
if index == nil {
b.err = errors.Errorf("index `%v` is not found in table `%v`", v.IndexName, v.Table.Name.O)
b.err = errors.Errorf("secondary index `%v` is not found in table `%v`", v.IndexName, v.Table.Name.O)
return nil
}
e := &RecoverIndexExec{
Expand Down Expand Up @@ -575,7 +575,7 @@ func (b *executorBuilder) buildCleanupIndex(v *plannercore.CleanupIndex) Executo
}

if index == nil {
b.err = errors.Errorf("index `%v` is not found in table `%v`", v.IndexName, v.Table.Name.O)
b.err = errors.Errorf("secondary index `%v` is not found in table `%v`", v.IndexName, v.Table.Name.O)
return nil
}
e := &CleanupIndexExec{
Expand Down
2 changes: 1 addition & 1 deletion planner/core/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ func (b *PlanBuilder) buildAdminCheckTable(ctx context.Context, as *ast.AdminStm
}
}
if idx == nil {
return nil, errors.Errorf("index %s do not exist", as.Index)
return nil, errors.Errorf("secondary index %s does not exist", as.Index)
}
if idx.Meta().State != model.StatePublic {
return nil, errors.Errorf("index %s state %s isn't public", as.Index, idx.Meta().State)
Expand Down

0 comments on commit 6a9da0f

Please sign in to comment.