trikker opened a new issue, #29715:
URL: https://github.com/apache/doris/issues/29715

   ### 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
   
   doris-2.0.4-rc02-e529646
   
   ### What's Wrong?
   
   doris :
   ```
   mysql> create table t2 (id int, num bigint) UNIQUE KEY(id) distributed by 
hash(id);
   Query OK, 0 rows affected (0.03 sec)
   
   mysql> insert into t2 values(1, 8442867910625079442);
   Query OK, 1 row affected (0.04 sec)
   {'label':'insert_34422d7d6ce44f88_b688f69da5d3e410', 'status':'VISIBLE', 
'txnId':'16378678'}
   
   mysql> insert into t2 values(2, 5211348103418720126);
   Query OK, 1 row affected (0.04 sec)
   {'label':'insert_d6ae68853bf14511_9cca2e5f511b0a06', 'status':'VISIBLE', 
'txnId':'16379094'}
   
   mysql> select sum(num) / 1024 / 1024 / 1024 from t2;
   
+-----------------------------------------------------------------------------------------------------+
   | (((cast(sum(num) as DOUBLE) / cast(1024 as DOUBLE)) / cast(1024 as 
DOUBLE)) / cast(1024 as DOUBLE)) |
   
+-----------------------------------------------------------------------------------------------------+
   |                                                                            
     -4463389571.4448318 |
   
+-----------------------------------------------------------------------------------------------------+
   1 row in set (0.03 sec)
   
   mysql> select sum(num) from t2;
   +----------------------+
   | sum(num)             |
   +----------------------+
   | -4792528059665752048 |
   +----------------------+
   1 row in set (0.02 sec)
   
   
   ```
   
   MySQL:
   ```
   mysql> use testdb
   Database changed
   mysql> create table t2 (id int auto_increment primary key, num bigint);
   Query OK, 0 rows affected (0.00 sec)
   
   mysql> insert into t2 values(1, 8442867910625079442);
   Query OK, 1 row affected (0.00 sec)
   
   mysql> insert into t2 values(2, 5211348103418720126);
   Query OK, 1 row affected (0.00 sec)
   
   mysql> select sum(num) / 1024 / 1024 / 1024 from t2;
   +-------------------------------+
   | sum(num) / 1024 / 1024 / 1024 |
   +-------------------------------+
   |      12716479612.555168166757 |
   +-------------------------------+
   1 row in set (0.00 sec)
   
   mysql> select sum(num) from t2;
   +----------------------+
   | sum(num)             |
   +----------------------+
   | 13654216014043799568 |
   +----------------------+
   1 row in set (0.00 sec)
   
   ```
   
   ### What You Expected?
   
   In doris, the value is overflowed and should be negtive.
   
   ### How to Reproduce?
   
   See "What's Wrong"
   
   ### Anything Else?
   
   No
   
   ### 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

Reply via email to