MySQL 5.6.14 Source Code Document
|
#include <item_sum.h>
Public Types | |
enum | Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR } |
Public Member Functions | |
Aggregator (Item_sum *arg) | |
virtual Aggregator_type | Aggrtype ()=0 |
virtual bool | setup (THD *)=0 |
virtual void | clear ()=0 |
virtual bool | add ()=0 |
virtual void | endup ()=0 |
virtual my_decimal * | arg_val_decimal (my_decimal *value)=0 |
virtual double | arg_val_real ()=0 |
virtual bool | arg_is_null ()=0 |
Protected Attributes | |
Item_sum * | item_sum |
bool | use_distinct_values |
Friends | |
class | Item_sum |
class | Item_sum_sum |
class | Item_sum_count |
class | Item_sum_avg |
Additional Inherited Members | |
Static Public Member Functions inherited from Sql_alloc | |
static void * | operator new (size_t size) throw () |
static void * | operator new[] (size_t size) throw () |
static void * | operator new[] (size_t size, MEM_ROOT *mem_root) throw () |
static void * | operator new (size_t size, MEM_ROOT *mem_root) throw () |
static void | operator delete (void *ptr, size_t size) |
static void | operator delete (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, size_t size) |
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 (quick_group = 0);
Definition at line 42 of file item_sum.h.
|
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_simple, and Aggregator_distinct.
|
pure virtual |
NULLness of being-aggregated argument; can be called only after arg_val_decimal() or arg_val_real().
Implemented in Aggregator_simple, and Aggregator_distinct.
|
pure virtual |
Decimal value of being-aggregated argument
Implemented in Aggregator_simple, and Aggregator_distinct.
|
pure virtual |
Floating point value of being-aggregated argument
Implemented in Aggregator_simple, and Aggregator_distinct.
|
pure virtual |
Called when we need to wipe out all the data from the aggregator : all the values acumulated and all the state. Cleans up the internal structures and resets them to their initial state.
Implemented in Aggregator_simple, and Aggregator_distinct.
|
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_simple, and Aggregator_distinct.
|
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_simple, and Aggregator_distinct.
|
protected |
When feeding back the data in endup() from Unique/temp table back to Item_sum::add() methods we must read the data from Unique (and not recalculate the functions that are given as arguments to the aggregate function. This flag is to tell the add() methods to take the data from the Unique instead by calling the relevant val_..() method
Definition at line 66 of file item_sum.h.