diff --git a/executor/update.go b/executor/update.go index d589a05c00570..e220ea3786b31 100644 --- a/executor/update.go +++ b/executor/update.go @@ -190,6 +190,10 @@ func (e *UpdateExec) handleErr(colName model.CIStr, rowIdx int, err error) error return resetErrDataTooLong(colName.O, rowIdx+1, err) } + if types.ErrOverflow.Equal(err) { + return types.ErrWarnDataOutOfRange.GenWithStackByArgs(colName.O, rowIdx+1) + } + return errors.Trace(err) } diff --git a/executor/write_test.go b/executor/write_test.go index c380ee9b89a9b..042d77a2ca306 100644 --- a/executor/write_test.go +++ b/executor/write_test.go @@ -1081,6 +1081,13 @@ func (s *testSuite) TestUpdate(c *C) { tk.MustExec(`CREATE TABLE t1 (c1 float)`) tk.MustExec("INSERT INTO t1 SET c1 = 1") tk.MustExec("UPDATE t1 SET c1 = 1.2 WHERE c1=1;") + + // issue 8119 + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t (c1 float(1,1));") + tk.MustExec("insert into t values (0.0);") + _, err = tk.Exec("update t set c1 = 2.0;") + c.Assert(types.ErrWarnDataOutOfRange.Equal(err), IsTrue) } func (s *testSuite) TestPartitionedTableUpdate(c *C) {