Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
foreyes committed Oct 8, 2019
1 parent 08acb9d commit 3869a47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2051,9 +2051,9 @@ func (b *PlanBuilder) buildSelect(ctx context.Context, sel *ast.SelectStmt) (p L
b.pushSelectOffset(sel.QueryBlockOffset)
b.pushTableHints(sel.TableHints, typeSelect, sel.QueryBlockOffset)
defer func() {
defer b.popSelectOffset()
b.popSelectOffset()
// table hints are only visible in the current SELECT statement.
defer b.popTableHints()
b.popTableHints()
}()

if sel.SelectStmtOpts != nil {
Expand Down Expand Up @@ -2704,9 +2704,9 @@ func (b *PlanBuilder) buildUpdate(ctx context.Context, update *ast.UpdateStmt) (
b.pushSelectOffset(0)
b.pushTableHints(update.TableHints, typeUpdate, 0)
defer func() {
defer b.popSelectOffset()
b.popSelectOffset()
// table hints are only visible in the current UPDATE statement.
defer b.popTableHints()
b.popTableHints()
}()

// update subquery table should be forbidden
Expand Down Expand Up @@ -2947,9 +2947,9 @@ func (b *PlanBuilder) buildDelete(ctx context.Context, delete *ast.DeleteStmt) (
b.pushSelectOffset(0)
b.pushTableHints(delete.TableHints, typeDelete, 0)
defer func() {
defer b.popSelectOffset()
b.popSelectOffset()
// table hints are only visible in the current DELETE statement.
defer b.popTableHints()
b.popTableHints()
}()

p, err := b.buildResultSetNode(ctx, delete.TableRefs.TableRefs)
Expand Down

0 comments on commit 3869a47

Please sign in to comment.