summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <wax@kishkin.ru>2004-08-10 15:48:22 +0600
committerunknown <wax@kishkin.ru>2004-08-10 15:48:22 +0600
commit700c2d621dfc11c6c1c3778ae804a7beca74c553 (patch)
treed16591498f6bb7bfd932966aac7a5393c202b763 /sql/item_sum.cc
parentce804e4c7bc514cb6823effb7ac396740be8f359 (diff)
downloadmariadb-git-700c2d621dfc11c6c1c3778ae804a7beca74c553.tar.gz
BUG#4315
BUG#4535 BUG#4686 mysql-test/r/func_gconcat.result: add testes of blobs and null values mysql-test/t/func_gconcat.test: add testes of blobs and null values sql/item_sum.cc: replace code with maybe_null and change store mode of fields
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 7a8e15e0a9d..b7eb1b7219b 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1966,14 +1966,13 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Fix fields for select list and ORDER clause
*/
- for (i= 0 ; i < arg_count ; i++)
+ for (uint i=0 ; i < arg_count ; i++)
{
if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1))
return 1;
- if (i < arg_count_field && args[i]->maybe_null)
- maybe_null= 0;
+ maybe_null |= args[i]->maybe_null;
}
-
+
result_field= 0;
null_value= 1;
max_length= group_concat_max_len;
@@ -1993,6 +1992,8 @@ bool Item_func_group_concat::setup(THD *thd)
uint const_fields;
byte *record;
qsort_cmp2 compare_key;
+ Copy_field *ptr;
+ Copy_field *end;
DBUG_ENTER("Item_func_group_concat::setup");
if (select_lex->linkage == GLOBAL_OPTIONS_TYPE)
@@ -2054,6 +2055,16 @@ bool Item_func_group_concat::setup(THD *thd)
key_length= table->reclength;
record= table->record[0];
+ /*
+ We need to store value of blob in buffer of a record instead of a pointer of
+ one.
+ */
+ ptr=tmp_table_param->copy_field;
+ end=tmp_table_param->copy_field_end;
+
+ for (; ptr != end; ptr++)
+ ptr->set(ptr->to_field,ptr->from_field,1);
+
/* Offset to first result field in table */
field_list_offset= table->fields - (list.elements - const_fields);