summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-01-15 01:05:00 -0800
committerunknown <igor@rurik.mysql.com>2005-01-15 01:05:00 -0800
commit16f3170e7352b06a8b142bfef89bbcc383c2a676 (patch)
tree3adb20484b260235a7782a6a75a8fc120a8e69e3 /sql/item_sum.h
parent6f70a1d90931f34adb3bdc8b15e20b768af4f357 (diff)
downloadmariadb-git-16f3170e7352b06a8b142bfef89bbcc383c2a676.tar.gz
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. sql/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. mysql-test/t/func_gconcat.test: Added a test case for bug #7769. mysql-test/r/func_gconcat.result: Added a test case for bug #7769.
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index cec611b8854..d1e82387944 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -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);