Bug #39146 Convertion to unsigned bigint where it must be signed int

Submitted: 1 Sep 2008 5:08 Modified: 11 Sep 2008 10:10
Reporter: Abdullah Sawas Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:4.1.22-standard-log, 4.1, 5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any

[1 Sep 2008 5:08] Abdullah Sawas
Description:
the script will show the bug ;)

CREATE TABLE `table1` (
  `dateline` int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table `table1`
-- 

INSERT INTO `table1` VALUES (1220226152);

SELECT dateline, 1220229263, dateline - 1220229263, 1220226152 - 1220229263, -(-dateline + 1220229263)
FROM table1

How to repeat:
CREATE TABLE `table1` (
  `dateline` int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table `table1`
-- 

INSERT INTO `table1` VALUES (1220226152);

SELECT dateline, 1220229263, dateline - 1220229263, 1220226152 - 1220229263, -(-dateline + 1220229263)
FROM table1

Suggested fix:
??
[1 Sep 2008 14:00] Sveta Smirnova
Thank you for the report.

Verified as described.

I think this is mostly documentation problem.
[2 Sep 2008 11:36] Abdullah Sawas
Thank you for responding.

Can you please tell me what do you mean by documentation problem?
[11 Sep 2008 10:10] Sergei Golubchik
Expected behavior. Search the manual for NO_UNSIGNED_SUBTRACTION

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.053 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.