Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.2.12, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
Description
SELECT returns wrong data when UNION ALL is used and first table has unsigned column and second table has signed data in this column.
Example:
CREATE TABLE `pokus` (
|
`id` INT NOT NULL,
|
`unsigned_column` SMALLINT UNSIGNED NOT NULL,
|
PRIMARY KEY (`id`));
|
|
INSERT INTO `pokus` (`id`, `unsigned_column`) VALUES ('1', '5'); |
|
SELECT id, unsigned_column FROM pokus
|
UNION ALL
|
SELECT id, -unsigned_column FROM pokus;
|
result:
'1', '5' |
'1', '0' |
Second row has 0 in second column, it should have -5.