In simple (non-distinct) case Item_udf_sum::clear() seem to be the only thing
done currently:
Item_sum::no_rows_in_result()
Item_sum::aggregator_clear()
Aggregator_simple::clear()
Item_udf_sum::clear()
Distinct case seem to be impossible with UDF's. So all we have now should be
fully compatible with this patch.
Reply from Kentoku:
Please check only this point.
diff -Narup ./008_mariadb-10.0.15-partition_direct_update/sql/item_sum.h
./009_mariadb-10.0.15-dbg/sql/item_sum.h
--- ./008_mariadb-10.0.15-partition_direct_update/sql/item_sum.h
2014-11-22 06:02:54.000000000 +0900
+++ ./009_mariadb-10.0.15-dbg/sql/item_sum.h 2014-11-29 17:02:32.059795158 +0900
@@ -1193,6 +1193,7 @@ public:
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
virtual bool have_field_update(void) const { return 0; }
+ virtual void no_rows_in_result() { clear(); }
void clear();
bool add();
void reset_field() {};
When I tried using aggregate type UDF, it didn't work. So I tried to
add this line into Item_udf_sum class as MySQL 5.1's Item_sum class.
I will try to reproduce it.