Loading mysql-test/r/group_by.result +9 −0 Original line number Diff line number Diff line Loading @@ -629,3 +629,12 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; alias 1,2 1,2 1 drop table t1; mysql-test/t/group_by.test +9 −0 Original line number Diff line number Diff line Loading @@ -456,3 +456,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5); SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; # Test for BUG#5400: GROUP_CONCAT returns everything twice. create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; drop table t1; sql/item_sum.cc +2 −0 Original line number Diff line number Diff line Loading @@ -2121,6 +2121,8 @@ String* Item_func_group_concat::val_str(String* str) DBUG_ASSERT(fixed == 1); if (null_value) return 0; if (result.length()) return &result; if (tree_mode) { tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this, Loading Loading
mysql-test/r/group_by.result +9 −0 Original line number Diff line number Diff line Loading @@ -629,3 +629,12 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; alias 1,2 1,2 1 drop table t1;
mysql-test/t/group_by.test +9 −0 Original line number Diff line number Diff line Loading @@ -456,3 +456,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5); SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; # Test for BUG#5400: GROUP_CONCAT returns everything twice. create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; drop table t1;
sql/item_sum.cc +2 −0 Original line number Diff line number Diff line Loading @@ -2121,6 +2121,8 @@ String* Item_func_group_concat::val_str(String* str) DBUG_ASSERT(fixed == 1); if (null_value) return 0; if (result.length()) return &result; if (tree_mode) { tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this, Loading