summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-08-31 18:26:50 +0400
committerunknown <evgen@moonbone.local>2005-08-31 18:26:50 +0400
commitfc45b816f725821044bf7e0307f20e97eaabf06f (patch)
treeecc36432e814cd8518b1898ad8522a52c18fa634 /sql/item_sum.cc
parentf17853cb8512ee857e5617f9141e886b4cf74f60 (diff)
downloadmariadb-git-fc45b816f725821044bf7e0307f20e97eaabf06f.tar.gz
Fix bug #12861 client hang with group_concat insubquery FROM DUAL.
Item_func_group_concat::fix_fields() set maybe_null flag to 0, and set it to 1 only if some of it's arguments may be null. When used in subquery in tmp table created field which can't be null. When no data retireved result field have to be set to null and error mentioned in bug report occurs. Also this bug can occur if selecting from not null field in empty table. Function group_concat now marked maybe_null from the very beginning not only if some of it's argument may be null. sql/item_sum.cc: Fix bug #12861 client hang with group_concat insubquery FROM DUAL. mysql-test/r/func_gconcat.result: Test case for bug #12861 client hang with group_concat insubquery FROM DUAL. mysql-test/t/func_gconcat.test: Test case for bug #12861 client hang with group_concat insubquery FROM DUAL.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 74a7fee113e..000dcdb4997 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1916,7 +1916,7 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
thd->allow_sum_func= 0;
- maybe_null= 0;
+ maybe_null= 1;
item_thd= thd;
/*
@@ -1929,8 +1929,6 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
args[i]->fix_fields(thd, tables, args + i)) ||
args[i]->check_cols(1))
return 1;
- if (i < arg_count_field)
- maybe_null|= args[i]->maybe_null;
}
if (agg_item_charsets(collation, func_name(),