MySQL 8.0.39
Source Code Documentation
|
The abstract base class for the Aggregator_* classes. More...
#include <item_sum.h>
Public Types | |
enum | Aggregator_type { SIMPLE_AGGREGATOR , DISTINCT_AGGREGATOR } |
Public Member Functions | |
Aggregator (Item_sum *arg) | |
virtual | ~Aggregator ()=default |
virtual Aggregator_type | Aggrtype ()=0 |
virtual bool | setup (THD *)=0 |
Called before adding the first row. More... | |
virtual void | clear ()=0 |
Called when we need to wipe out all the data from the aggregator: all the values accumulated and all the state. More... | |
virtual bool | add ()=0 |
Called when there's a new value to be aggregated. More... | |
virtual void | endup ()=0 |
Called when there are no more data and the final value is to be retrieved. More... | |
virtual my_decimal * | arg_val_decimal (my_decimal *value)=0 |
Decimal value of being-aggregated argument. More... | |
virtual double | arg_val_real ()=0 |
Floating point value of being-aggregated argument. More... | |
virtual bool | arg_is_null (bool use_null_value)=0 |
NULLness of being-aggregated argument. More... | |
Protected Attributes | |
Item_sum * | item_sum |
Friends | |
class | Item_sum |
class | Item_sum_sum |
class | Item_sum_count |
class | Item_sum_avg |
The abstract base class for the Aggregator_* classes.
It implements the data collection functions (setup/add/clear) as either pass-through to the real functionality or as collectors into an Unique (for distinct) structure.
Note that update_field/reset_field are not in that class, because they're simply not called when GROUP BY/DISTINCT can be handled with help of index on grouped fields (allow_group_via_temp_table is false);
|
inline |
|
virtualdefault |
|
pure virtual |
Called when there's a new value to be aggregated.
Updates the internal state of the aggregator to reflect the new value.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
NULLness of being-aggregated argument.
use_null_value | Optimization: to determine if the argument is NULL we must, in the general case, call is_null() on it, which itself might call val_*() on it, which might be costly. If you just have called arg_val*(), you can pass use_null_value=true; this way, arg_is_null() might avoid is_null() and instead do a cheap read of the Item's null_value (updated by arg_val*()). |
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Decimal value of being-aggregated argument.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Floating point value of being-aggregated argument.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Called when we need to wipe out all the data from the aggregator: all the values accumulated and all the state.
Cleans up the internal structures and resets them to their initial state.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Called when there are no more data and the final value is to be retrieved.
Finalises the state of the aggregator, so the final result can be retrieved.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
pure virtual |
Called before adding the first row.
Allocates and sets up the internal aggregation structures used, e.g. the Unique instance used to calculate distinct.
Implemented in Aggregator_distinct, and Aggregator_simple.
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |