summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-05-16 15:07:04 +0300
committerMichael Widenius <monty@askmonty.org>2011-05-16 15:07:04 +0300
commit8543621fa0f4a3c4102ac8f799888ef79e2e1dcf (patch)
tree29e8f301ef929cfe1c00eec9dee265aa0acaa350 /sql/item_sum.cc
parentf458e198c0bea67c6a3787738108bbfb139639bd (diff)
parentbcee6652c6052cabd67f8d30c14e162235749d38 (diff)
downloadmariadb-git-8543621fa0f4a3c4102ac8f799888ef79e2e1dcf.tar.gz
Merge with 5.3 main
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 51754fbd9ee..2479f8ea92a 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1049,9 +1049,10 @@ bool Item_sum_distinct::unique_walk_function(void *element)
void Item_sum_distinct::clear()
{
DBUG_ENTER("Item_sum_distinct::clear");
- DBUG_ASSERT(tree != 0); /* we always have a tree */
+ /* During EXPLAIN there is no tree because it is created during execution. */
+ if (tree != 0)
+ tree->reset();
null_value= 1;
- tree->reset();
is_evaluated= FALSE;
DBUG_VOID_RETURN;
}