We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
set @@tidb_opt_agg_push_down=1; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` tinyint(4) NOT NULL, PRIMARY KEY (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin PARTITION BY RANGE ( `b` ) ( PARTITION `p0` VALUES LESS THAN (10), PARTITION `p1` VALUES LESS THAN (20), PARTITION `p2` VALUES LESS THAN (30), PARTITION `p3` VALUES LESS THAN (40), PARTITION `p4` VALUES LESS THAN (MAXVALUE) ); insert into t1 values (0, 0), (1, 1), (1, 2), (1, 3), (2, 4), (2, 5), (2, 6), (3, 7), (3, 10), (3, 11), (12, 12), (12, 13), (14, 14), (14, 15), (20, 20), (20, 21), (20, 22), (23, 23), (23, 24), (23, 25), (31, 30), (31, 31), (31, 32), (33, 33), (33, 34), (33, 35), (36, 36), (80, 80), (90, 90), (100, 100); select /*+ AGG_TO_COP() */ sum(a), sum(b) from t1 where a < 40 group by a;
the query works fine
tidb> select /*+ AGG_TO_COP() */ sum(a), sum(b) from t1 where a < 40 group by a; ERROR 1105 (HY000): runtime error: index out of range [0] with length 0
tidb-server -V
select tidb_version();
tidb> select tidb_version(); +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tidb_version() | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Release Version: v4.0.0-beta.2-343-ge607157ef Git Commit Hash: e607157efef0f76878d18a667b233061ce43545a Git Branch: master UTC Build Time: 2020-04-27 06:44:46 GoVersion: go1.13 Race Enabled: false TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 Check Table Before Drop: false | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
The text was updated successfully, but these errors were encountered:
I can't reproduce in the newest master branch.
Sorry, something went wrong.
@lzmhhh123 We need to set @@tidb_opt_agg_push_down=1;
set @@tidb_opt_agg_push_down=1;
lzmhhh123
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
2. What did you expect to see?
the query works fine
3. What did you see instead?
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: