func_gconcat.result, func_gconcat.test:

Added a test case for bug #7769.
item_sum.h:
  Fixed bug #7769: a crash for queries with group_concat and
  having when the query table was empty.
  The bug was due an unsafe dereferencing.
This commit is contained in:
igor@rurik.mysql.com 2005-01-15 01:05:00 -08:00
commit cd577f2590
3 changed files with 15 additions and 2 deletions

View file

@ -739,9 +739,10 @@ class Item_func_group_concat : public Item_sum
String *res;
char *end_ptr;
int error;
res= val_str(&str_value);
if (!(res= val_str(&str_value)))
return (longlong) 0;
end_ptr= (char*) res->ptr()+ res->length();
return res ? my_strtoll10(res->ptr(), &end_ptr, &error) : (longlong) 0;
return my_strtoll10(res->ptr(), &end_ptr, &error);
}
String* val_str(String* str);
Item *copy_or_same(THD* thd);