Bug #99568 update return error with virtual generated column
Submitted: 14 May 2020 8:38 Modified: 14 May 2020 9:41
Reporter: wj huang Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[14 May 2020 8:38] wj huang
Description:
Consider the following statement:

mysql> create table t1(a int , b tinyint as (a+100) unique key);
Query OK, 0 rows affected (0.01 sec)

mysql> insert ignore into t1 values(200, default);
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> update t1 set a=0 where a=200;
ERROR 1264 (22003): Out of range value for column 'b' at row 1

Expected outcome: update successfully.

How to repeat:
create table t1(a int , b tinyint as (a+100) unique key);
insert ignore into t1 values(200, default);
update t1 set a=0 where a=200;
[14 May 2020 9:41] MySQL Verification Team
Thank you for the bug report.
[21 May 2020 12:02] MySQL Verification Team
The following bug is a duplicate of this original:

https://bugs.mysql.com/bug.php?id=99640