Skip to content

Commit

Permalink
executor: fix panic during update stmt (#36230) (#36528)
Browse files Browse the repository at this point in the history
close #32311
  • Loading branch information
ti-srebot committed Aug 2, 2022
1 parent c5987a8 commit 99dfc62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5179,6 +5179,11 @@ func CheckUpdateList(assignFlags []int, updt *Update, newTblID2Table map[int64]t
}

for i, col := range tbl.WritableCols() {
// schema may be changed between building plan and building executor
// If i >= len(flags), it means the target table has been added columns, then we directly skip the check
if i >= len(flags) {
continue
}
if flags[i] >= 0 && col.State != model.StatePublic {
return ErrUnknownColumn.GenWithStackByArgs(col.Name, clauseMsg[fieldList])
}
Expand Down

0 comments on commit 99dfc62

Please sign in to comment.