|
|
|
|
@ -559,7 +559,7 @@ func (b *PlanBuilder) Build(ctx context.Context, node *resolve.NodeW) (base.Plan
|
|
|
|
|
*ast.GrantStmt, *ast.DropUserStmt, *ast.AlterUserStmt, *ast.AlterRangeStmt, *ast.RevokeStmt, *ast.KillStmt, *ast.DropStatsStmt,
|
|
|
|
|
*ast.GrantRoleStmt, *ast.RevokeRoleStmt, *ast.SetRoleStmt, *ast.SetDefaultRoleStmt, *ast.ShutdownStmt,
|
|
|
|
|
*ast.RenameUserStmt, *ast.NonTransactionalDMLStmt, *ast.SetSessionStatesStmt, *ast.SetResourceGroupStmt,
|
|
|
|
|
*ast.ImportIntoActionStmt, *ast.CalibrateResourceStmt, *ast.AddQueryWatchStmt, *ast.DropQueryWatchStmt:
|
|
|
|
|
*ast.ImportIntoActionStmt, *ast.CalibrateResourceStmt, *ast.AddQueryWatchStmt, *ast.DropQueryWatchStmt, *ast.DropProcedureStmt:
|
|
|
|
|
return b.buildSimple(ctx, node.Node.(ast.StmtNode))
|
|
|
|
|
case ast.DDLNode:
|
|
|
|
|
return b.buildDDL(ctx, x)
|
|
|
|
|
@ -580,7 +580,7 @@ func (b *PlanBuilder) Build(ctx context.Context, node *resolve.NodeW) (base.Plan
|
|
|
|
|
case *ast.RecommendIndexStmt:
|
|
|
|
|
return b.buildRecommendIndex(x)
|
|
|
|
|
}
|
|
|
|
|
return nil, plannererrors.ErrUnsupportedType.GenWithStack("Unsupported type %T", node)
|
|
|
|
|
return nil, plannererrors.ErrUnsupportedType.GenWithStack("Unsupported type %T", node.Node)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *PlanBuilder) buildSetConfig(ctx context.Context, v *ast.SetConfigStmt) (base.Plan, error) {
|
|
|
|
|
@ -3752,6 +3752,13 @@ func (b *PlanBuilder) buildSimple(ctx context.Context, node ast.StmtNode) (base.
|
|
|
|
|
err := plannererrors.ErrSpecificAccessDenied.GenWithStackByArgs("SUPER or RESOURCE_GROUP_ADMIN or RESOURCE_GROUP_USER")
|
|
|
|
|
b.visitInfo = appendDynamicVisitInfo(b.visitInfo, []string{"RESOURCE_GROUP_ADMIN", "RESOURCE_GROUP_USER"}, false, err)
|
|
|
|
|
}
|
|
|
|
|
case *ast.DropProcedureStmt:
|
|
|
|
|
procName := fmt.Sprintf("%s.%s", ast.NewCIStr(b.ctx.GetSessionVars().CurrentDB).O, raw.ProcedureName.Name.O)
|
|
|
|
|
err := plannererrors.ErrSpDoesNotExist.GenWithStackByArgs("PROCEDURE", procName)
|
|
|
|
|
if !raw.IfExists {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
b.ctx.GetSessionVars().StmtCtx.AppendNote(err)
|
|
|
|
|
}
|
|
|
|
|
return p, nil
|
|
|
|
|
}
|
|
|
|
|
|