[MDEV-6494] update ignore fails on overflow Created: 2014-07-28  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.38, 10.0.12, 10.1.0, 10.3.4
Fix Version/s: 5.5

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: upstream


 Description   

dumb and probably upstream

MariaDB [test]> create table x (x bigint unsigned);
Query OK, 0 rows affected (0.09 sec)
 
MariaDB [test]> insert into x values (37000);
Query OK, 1 row affected (0.07 sec)
 
MariaDB [test]> update ignore x set x=x*x;
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
MariaDB [test]> update ignore x set x=x*x;
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
MariaDB [test]> update ignore x set x=x*x;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(`test`.`x`.`x` * `test`.`x`.`x`)'



 Comments   
Comment by Elena Stepanova [ 2014-07-28 ]

Reproducible on MySQL 5.5, 5.6, 5.7.
Refiled as http://bugs.mysql.com/bug.php?id=73410

Comment by Nuno [ 2019-02-07 ]

The same happens when you have an UNSIGNED BIGINT and you do -1 when the field is currently 0.

I set NO_UNSIGNED_SUBTRACTION to ensure it doesn't overflow, but I want "UPDATE IGNORE" to not cause this query to fail.

It should be a warning, not an error (with UPDATE IGNORE).

Generated at Thu Feb 08 07:12:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.