-
-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
A-featurefeature with good ideafeature with good ideaB-storagedata type, data storage, insert,update,delete, transactionsdata type, data storage, insert,update,delete, transactionsC-stonedb-5.7associated with stonedb 5.7associated with stonedb 5.7prio: normalMedium priorityMedium priority
Milestone
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Please confirm if bug report does NOT exists already ?
- I confirm there is no existing issue for this
Describe the problem
mysql> CREATE TABLE `test` (
-> `id` bigint(20) DEFAULT NULL
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> insert into test values(9223372036854775801);
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values(9223372036854775802);
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values(9223372036854775803);
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values(9223372036854775804);
Query OK, 1 row affected (0.00 sec)
mysql> select * from test;
+---------------------+
| id |
+---------------------+
| 9223372036854775801 |
| 9223372036854775802 |
| 9223372036854775803 |
| 9223372036854775804 |
+---------------------+
4 rows in set (0.00 sec)
mysql> SELECT SUM(id) FROM test;
ERROR 1105 (HY000): Aggregation overflow.
mysql> SELECT AVG(id) FROM test;
ERROR 2013 (HY000): Lost connection to MySQL server during queryExpected behavior
mysql> SELECT SUM(id) FROM test;
+----------------------+
| SUM(id) |
+----------------------+
| 36893488147419103210 |
+----------------------+
1 row in set (0.00 sec)
mysql> SELECT AVG(id) FROM test;
+--------------------------+
| AVG(id) |
+--------------------------+
| 9223372036854775802.5000 |
+--------------------------+
1 row in set (0.00 sec)How To Reproduce
CREATE TABLE `test` (
`id` bigint(20) DEFAULT NULL
);
insert into test values(9223372036854775801);
insert into test values(9223372036854775802);
insert into test values(9223372036854775803);
insert into test values(9223372036854775804);
SELECT AVG(id) FROM test;
SELECT SUM(id) FROM test;Environment
root@ub01:~# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: 1fa9d3346
Last commit time: Date: Fri Jan 13 07:03:20 2023 +0000
Build time: Date: Fri Jan 13 17:22:15 CST 2023
root@ub01:~# cat /etc/issue
Ubuntu 20.04.5 LTS \n \lAre you interested in submitting a PR to solve the problem?
- Yes, I will!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-featurefeature with good ideafeature with good ideaB-storagedata type, data storage, insert,update,delete, transactionsdata type, data storage, insert,update,delete, transactionsC-stonedb-5.7associated with stonedb 5.7associated with stonedb 5.7prio: normalMedium priorityMedium priority
Type
Projects
Status
Todo