CAST(2.2222 AS DECIMAL(26, 2)) != 2.22 运算结果与MySQL不一致

Viewed 52
-- Version : doris-2.0.11
SELECT 1 FROM DUAL WHERE CAST(2.2222 AS DECIMAL(26, 2)) != 2.22
> 1

SELECT 1 FROM DUAL WHERE CAST(2.2222 AS DECIMAL(26, 2)) = 2.22 
> 

SELECT 1 FROM DUAL WHERE CAST(0.0002 AS DECIMAL(26, 2)) != 0.00
>

SELECT 1 FROM DUAL WHERE CAST(0.0002 AS DECIMAL(26, 2)) = 0.00
> 1


-- Version : mysql-8.0.32
SELECT 1 FROM DUAL WHERE CAST(2.2222 AS DECIMAL(26, 2)) != 2.22;
>

SELECT 1 FROM DUAL WHERE CAST(2.2222 AS DECIMAL(26, 2)) = 2.22;
> 1

SELECT 1 FROM DUAL WHERE CAST(0.0002 AS DECIMAL(26, 2)) != 0.00
>

SELECT 1 FROM DUAL WHERE CAST(0.0002 AS DECIMAL(26, 2)) = 0.00
> 1

1 Answers

感谢反馈,后续会进行fix优化:https://github.com/apache/doris/pull/41151