Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Nov 23, 2021
1 parent 1cc20a2 commit 38581f6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions planner/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ func Optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in
useBinding = false
}
}
// add the extra Limit after matching the bind record
stmtNode = plannercore.TryAddExtraLimit(sctx, stmtNode)
node = stmtNode
if ok {
// add the extra Limit after matching the bind record
stmtNode = plannercore.TryAddExtraLimit(sctx, stmtNode)
node = stmtNode
}

var names types.NameSlice
var bestPlan, bestPlanFromBind plannercore.Plan
Expand Down Expand Up @@ -278,7 +280,7 @@ func allowInReadOnlyMode(sctx sessionctx.Context, node ast.Node) (bool, error) {
switch node.(type) {
// allow change variables (otherwise can't unset read-only mode)
case *ast.SetStmt,
// allow analyze table
// allow analyze table
*ast.AnalyzeTableStmt,
*ast.UseStmt,
*ast.ShowStmt,
Expand Down

0 comments on commit 38581f6

Please sign in to comment.