diff options
author | unknown <igor@rurik.mysql.com> | 2005-09-06 22:20:11 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2005-09-06 22:20:11 -0700 |
commit | d877cdf3e7fa6c176a2dea418deaa0bb2d9500ff (patch) | |
tree | a15c71fa469ce1f2ad833049715ab009a914378a /sql | |
parent | 291d59d4bf1d753fca6d10f1738aff4134e6f9fa (diff) | |
download | mariadb-git-d877cdf3e7fa6c176a2dea418deaa0bb2d9500ff.tar.gz |
func_gconcat.result, func_gconcat.test:
Added test cases for bug #12863.
item_sum.cc, item_sum.h:
Fixed bug #12863.
Added a flag to Item_func_group_concat set to FALSE after
concatenation of the first element of a group.
sql/item_sum.h:
Fixed bug #12863.
Added a flag to Item_func_group_concat set to FALSE after
concatenation of the first element of a group.
sql/item_sum.cc:
Fixed bug #12863.
Added a flag to Item_func_group_concat set to FALSE after
concatenation of the first element of a group.
mysql-test/t/func_gconcat.test:
Added test cases for bug #12863.
mysql-test/r/func_gconcat.result:
Added test cases for bug #12863.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_sum.cc | 8 | ||||
-rw-r--r-- | sql/item_sum.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 000dcdb4997..7f13fdf82b2 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1664,7 +1664,9 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), char buff[MAX_FIELD_WIDTH]; String tmp((char *)&buff,sizeof(buff),default_charset_info), tmp2; - if (item->result.length()) + if (item->no_appended) + item->no_appended= FALSE; + else item->result.append(*item->separator); tmp.length(0); @@ -1856,6 +1858,7 @@ void Item_func_group_concat::clear() result.copy(); null_value= TRUE; warning_for_row= FALSE; + no_appended= TRUE; if (tree_mode) reset_tree(tree); } @@ -1898,8 +1901,7 @@ bool Item_func_group_concat::add() void Item_func_group_concat::reset_field() { - if (tree_mode) - reset_tree(tree); + DBUG_ASSERT(0); } diff --git a/sql/item_sum.h b/sql/item_sum.h index a3b422565d1..d53d8d861ae 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -709,6 +709,7 @@ class Item_func_group_concat : public Item_sum uint arg_count_field; uint field_list_offset; uint count_cut_values; + bool no_appended; /* Following is 0 normal object and pointer to original one for copy (to correctly free resources) |