dble
dble copied to clipboard
Expect optimise the not easy understand error message: "Can't group on '_$COUNT$_rpda_0'"
-
dble version:
5.6.29-dble-9.9.9.9-6f54f427d25b89a820752e2354eaefd01f21acde-20191025035141 - preconditions :
drop table if exists sharding_2_t1;
create table sharding_2_t1(id int, name varchar(30) );
- configs:
schema.xml
<schema name="schema1" sqlMaxLimit="100" dataNode="dn5">
<table name="sharding_2_t1" primaryKey="id" dataNode="dn1,dn2" rule="hash-two" />
</schema>
-
steps:
step1. execute sql: select count(id) as clo2 from sharding_2_t1 group by clo2; -
expect result:
1.mysql> select count(id) as clo2 from sharding_2_t1 group by clo2; ERROR 1056 (42000): Can't group on 'clo2' -
real result:
1.mysql> select count(id) as clo2 from sharding_2_t1 group by clo2; ERROR 1003 (HY000): Can't group on '_$COUNT$_rpda_0' -
supplements:
1.
delay
hard to repair, keep it as a limitation
suggest using explain to understand the error
mysql> explain select count(id) as clo2 from sharding_2_t1 group by clo2;
+-------------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| DATA_NODE | TYPE | SQL/REF |
+-------------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| dn1_0 | BASE SQL | select COUNT(id) as `_$COUNT$_rpda_0`,COUNT(sharding_2_t1.id) as `_$COUNT$_rpda_1` from `sharding_2_t1` GROUP BY COUNT(id) ORDER BY _$COUNT$_rpda_1 ASC |
| dn2_0 | BASE SQL | select COUNT(id) as `_$COUNT$_rpda_0`,COUNT(sharding_2_t1.id) as `_$COUNT$_rpda_1` from `sharding_2_t1` GROUP BY COUNT(id) ORDER BY _$COUNT$_rpda_1 ASC |
| merge_and_order_1 | MERGE_AND_ORDER | dn1_0; dn2_0 |
| aggregate_1 | AGGREGATE | merge_and_order_1 |
| order_1 | ORDER | aggregate_1 |
| shuffle_field_1 | SHUFFLE_FIELD | order_1 |
+-------------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)