Bug 670256

Summary: mysql SQL update error...
Product: [Fedora] Fedora Reporter: dobs <webmaster>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 14CC: hhorak, tgl, webmaster
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-17 17:57:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description dobs 2011-01-17 17:10:44 UTC
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

Comment 1 Tom Lane 2011-01-17 17:57:32 UTC
I'm not convinced that's a bug at all, but in any case filing it upstream was sufficient.

Comment 2 dobs 2011-01-17 20:50:10 UTC
OK, if I will get answer from mysql, I will report here...