Bug 670256 - mysql SQL update error...
Summary: mysql SQL update error...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 14
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Tom Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-17 17:10 UTC by dobs
Modified: 2013-07-03 03:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-17 17:57:32 UTC
Type: ---


Attachments (Terms of Use)

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...


Note You need to log in before you can comment on or make changes to this bug.