dolt icon indicating copy to clipboard operation
dolt copied to clipboard

`DECIMAL` value in `union` query loses precision and scale information

Open jennifersp opened this issue 3 years ago • 0 comments

In MySQL:

mysql> with recursive t (n) as (select sum(1) from dual union all select (2.00) from dual) select sum(n) from t;
+--------+
| sum(n) |
+--------+
|   3.00 |
+--------+
1 row in set (0.00 sec)

In Dolt:

mydb1> with recursive t (n) as (select sum(1) from dual union all select (2.00) from dual) select sum(n) from t;
+--------+
| sum(n) |
+--------+
| 3      |
+--------+

This is from mergeUnionSchemas rule, decimal type is cast to string.

jennifersp avatar Sep 13 '22 19:09 jennifersp