Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add avg overflow test #3536

Merged
merged 3 commits into from
Dec 3, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions tests/tidb-ci/fullstack-test-dt/aggregation_push_down.test
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,58 @@ mysql> use test; set @@tidb_allow_mpp=1; select -1.2 from t group by id;
| -1.2 |
| -1.2 |
+------+

mysql> drop table if exists test.t;
mysql> create table test.t (value decimal(1,0));
mysql> alter table test.t set tiflash replica 1;
mysql> insert into test.t values(9);
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> analyze table test.t;

func> wait_table test t

mysql> use test; set @@tidb_allow_mpp=0; select avg(value) from test.t group by value;
+------------+
| avg(value) |
+------------+
| 9.0000 |
+------------+

mysql> use test; set @@tidb_allow_mpp=1; set @@tidb_enforce_mpp=1; select avg(value) from test.t group by value;
+------------+
| avg(value) |
+------------+
| 9.0000 |
+------------+

mysql> use test; set @@tidb_allow_mpp=0; select avg(value) from test.t;
+------------+
| avg(value) |
+------------+
| 9.0000 |
+------------+

mysql> use test; set @@tidb_allow_mpp=1; set @@tidb_enforce_mpp=1; select avg(value) from test.t;
+------------+
| avg(value) |
+------------+
| 9.0000 |
+------------+

mysql> drop table if exists test.t;