Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
5.5, 10.0, 10.1, 10.2.12, 10.2
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.