Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 5.5, 10.0, 10.1, 10.2
-
Fix Version/s: 10.3.1
-
Component/s: Data types
Description
Consider this SELECT with UNIONs using different data types for the same column:
SELECT 20 AS x UNION SELECT null UNION SELECT 2.2; |
Gives:
+------+
|
| x |
|
+------+
|
| 9.9 |
|
| NULL |
|
| 2.2 |
|
+------+
|
It seems somewhat non-intuitive that 9.9 becomes 20 ...!
The issue was first reported here:
https://dba.stackexchange.com/questions/204757/problem-with-union-casting-integer-to-ceilingdecimal