zxealous opened a new issue, #31522: URL: https://github.com/apache/doris/issues/31522
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version 2.0.5 ### What's Wrong? case: ``` create table test_cast_decimal_in_table (k1 tinyint, k2 decimal(6,3) NULL, k3 char(5) NULL, k4 date NULL, k5 datetime NULL, k6 double sum) engine=olap distributed by hash(k1) buckets 2 properties ("replication_allocation" = "tag.location.default: 1","storage_type"="column") insert into test_cast_decimal_in_table values(1, 123.23, 'a', '2019-01-01', '2019-01-01 01:00:00', 6.6); insert into test_cast_decimal_in_table values(1, 1.1267, 'a', '2019-01-01', '2019-01-01 01:00:00', 6.6); insert into test_cast_decimal_in_table values(1, 123.1234, 'a', '2019-01-01', '2019-01-01 01:00:00', 6.6); select cast(k2 as decimal(6, 4))from test_cast_decimal_in_table order by k2 limit 1 ``` the case on 2.0.5: ``` MySQL [test]> select cast(k2 as decimal(6, 4))from test_cast_decimal_in_table order by k2 limit 1; ERROR 1105 (HY000): errCode = 2, detailMessage = (10.81.85.90)[CANCELLED][E-124][E-124] Arithmetic overflow 0# doris::get_stack_trace[abi:cxx11](int) at /home/disk2/zcy/baidu/bdg/doris/PALO-2.0/be/src/util/stack_util.cpp:51 1# doris::Exception::Exception(int, std::basic_string_view<char, std::char_traits<char> >) at /home/disk2/zcy/baidu/bdg/doris/PALO-2.0/be/src/common/exception.cpp:27 2# auto doris::vectorized::convert_decimal_cols<doris::vectorized::DataTypeDecimal<doris::vectorized::Decimal<int> >, doris::vectorize ``` the case on master is right: ``` MySQL [test]> select cast(k2 as decimal(6, 4))from test_cast_decimal_in_table order by k2 limit 1; +-----------------------------+ | cast(k2 as DECIMALV3(6, 4)) | +-----------------------------+ | 1.1270 | +-----------------------------+ 1 row in set (0.033 sec) ``` ### What You Expected? work well ### How to Reproduce? _No response_ ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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: commits-unsubscr...@doris.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org