Hide Forgot
Description of problem: UNSIGNED update error Version-Release number of selected component (if applicable): 5.1.52 How reproducible: [root@wifi dobs]# mysql --password=*** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 23 Server version: 5.1.52 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE TABLE `demo`.`test` ( -> `id` INT( 3 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , -> `int1` INT( 4 ) UNSIGNED NOT NULL , -> `int2` INT( 4 ) UNSIGNED NOT NULL -> ) ENGINE = MYISAM ; Query OK, 0 rows affected (0.11 sec) mysql> INSERT INTO `demo`.`test` (`id` ,`int1` ,`int2` ) VALUES (NULL , '0', '10'); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM `demo`.`test`; +----+------+------+ | id | int1 | int2 | +----+------+------+ | 1 | 0 | 10 | +----+------+------+ 1 row in set (0.00 sec) mysql> UPDATE `demo`.`test` SET `int2` = '9' WHERE `test`.`id` =1; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> SELECT * FROM `demo`.`test`; +----+------+------+ | id | int1 | int2 | +----+------+------+ | 1 | 0 | 9 | +----+------+------+ 1 row in set (0.00 sec) mysql> UPDATE `demo`.`test` SET `int1` = (`int1`-1), `int2` = (`int2`-1) WHERE `test`.`id` =1; Query OK, 1 row affected, 1 warning (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> SELECT * FROM `demo`.`test`; +----+------------+------+ | id | int1 | int2 | +----+------------+------+ | 1 | 4294967295 | 8 | +----+------------+------+ 1 row in set (0.00 sec) Actual results: | 1 | 4294967295 | 8 | Expected results: | 1 | 0 | 8 | Additional info: + open bug on mysql http://bugs.mysql.com/bug.php?id=59426
I'm not convinced that's a bug at all, but in any case filing it upstream was sufficient.
OK, if I will get answer from mysql, I will report here...