summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 092531c1c9e..092c9728d47 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1579,8 +1579,12 @@ void Item_sum_count::clear()
bool Item_sum_count::add()
{
- if (!args[0]->maybe_null || !args[0]->is_null())
- count++;
+ for (uint i=0; i<arg_count; i++)
+ {
+ if (args[i]->maybe_null && args[i]->is_null())
+ return 0;
+ }
+ count++;
return 0;
}