Skip to content

Commit

Permalink
cherry pick pingcap#36230 to release-5.4
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
Yisaer authored and ti-srebot committed Jul 25, 2022
1 parent ef81f12 commit 109c8c4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4808,7 +4808,20 @@ func CheckUpdateList(assignFlags []int, updt *Update, newTblID2Table map[int64]t
flags := assignFlags[content.Start:content.End]
var update, updatePK bool
for i, col := range tbl.WritableCols() {
<<<<<<< HEAD
if flags[i] >= 0 && col.State != model.StatePublic {
=======
// 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 {
continue
}

if col.State != model.StatePublic {
>>>>>>> c76888143... executor: fix panic during update stmt (#36230)
return ErrUnknownColumn.GenWithStackByArgs(col.Name, clauseMsg[fieldList])
}
if flags[i] >= 0 {
Expand Down

0 comments on commit 109c8c4

Please sign in to comment.