Mryange commented on issue #40870:
URL: https://github.com/apache/doris/issues/40870#issuecomment-2359909357
```
| 0:VUNION(43)
|
| constant exprs:
|
| 0 | CAST(-2147483649 AS int) | 0 | 0 | 0
|
| tuple ids: 0
```
现在新优化器上会考虑规划一个cast,而cast的实现中,目前是不会检查是否超出范围的。
有在考虑超出范围的时候报错,这里有个demo
https://github.com/apache/doris/pull/40334
```
mysql [test]>set enable_strict_cast_mode = false;
Query OK, 0 rows affected (0.00 sec)
mysql [test]>select cast(k2 as int) from testdb;
+-----------------+
| cast(k2 as INT) |
+-----------------+
| -2147483648 |
+-----------------+
1 row in set (0.02 sec)
mysql [test]>set enable_strict_cast_mode = true;
Query OK, 0 rows affected (0.00 sec)
mysql [test]>select cast(k2 as int) from testdb;
ERROR 1105 (HY000): errCode = 2, detailMessage =
(127.0.0.1)[INVALID_ARGUMENT]Cast to type Int32 ,out of range 9.2173984e+18
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]