diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index d7cad573edd46..9a3dbbbe92462 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -4960,7 +4960,20 @@ func CheckUpdateList(assignFlags []int, updt *Update, newTblID2Table map[int64]t } 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 {