summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2001-05-24 18:00:52 -0600
committersasha@mysql.sashanet.com <>2001-05-24 18:00:52 -0600
commit8a3f87ab072f274e67259135c88c30a9dff166b9 (patch)
tree9aa9b9a1f9655b48f5e748c918b37c726b7d19ca /sql/item_sum.cc
parent072cca77b2107df1302ad183f86441f7006d8aed (diff)
downloadmariadb-git-8a3f87ab072f274e67259135c88c30a9dff166b9.tar.gz
fixed bug in count(distinct)
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 6560fdedfd2..879c27178e5 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -986,9 +986,12 @@ bool Item_sum_count_distinct::add()
{
// if the tree got too big, convert to MyISAM, otherwise
// insert into the tree
- if((tree.elements_in_tree > max_elements_in_tree && tree_to_myisam())
- ||
- !tree_insert(&tree, table->record[0] + rec_offset, 0))
+ if(tree.elements_in_tree > max_elements_in_tree)
+ {
+ if(tree_to_myisam())
+ return 1;
+ }
+ else if(!tree_insert(&tree, table->record[0] + rec_offset, 0))
return 1;
}
else if ((error=table->file->write_row(table->record[0])))