summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2008-05-01 13:49:26 +0300
committergkodinov/kgeorge@magare.gmz <>2008-05-01 13:49:26 +0300
commite22ef24263800a585a758e07f04464d37429e2b6 (patch)
treee158fef65a70f1ba06651b8abccf9b1318ae3856 /sql/item_sum.cc
parent771d861c99bbe2d65a54c928ae6e667c8a0a440c (diff)
downloadmariadb-git-e22ef24263800a585a758e07f04464d37429e2b6.tar.gz
Fix for bug #35298: GROUP_CONCAT with DISTINCT can crash the server
The bug is a regression introduced by the patch for bug32798. The code in Item_func_group_concat::clear() relied on the 'distinct' variable to check if 'unique_filter' was initialized. That, however, is not always valid because Item_func_group_concat::setup() can do shortcuts in some cases w/o initializing 'unique_filter'. Fixed by checking the value of 'unique_filter' instead of 'distinct' before dereferencing.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 91f9889b03f..91320d6b56b 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3222,7 +3222,7 @@ void Item_func_group_concat::clear()
no_appended= TRUE;
if (tree)
reset_tree(tree);
- if (distinct)
+ if (unique_filter)
unique_filter->reset();
/* No need to reset the table as we never call write_row */
}