MySQL 9.1.0
Source Code Documentation
Aggregator_simple Class Reference

The pass-through aggregator. More...

#include <item_sum.h>

Inheritance diagram for Aggregator_simple:
[legend]

Public Member Functions

 Aggregator_simple (Item_sum *sum)
 
Aggregator_type Aggrtype () override
 
bool setup (THD *thd) override
 Called before adding the first row. More...
 
void clear () override
 Called when we need to wipe out all the data from the aggregator: all the values accumulated and all the state. More...
 
bool add () override
 Called when there's a new value to be aggregated. More...
 
void endup () override
 Called when there are no more data and the final value is to be retrieved. More...
 
my_decimalarg_val_decimal (my_decimal *value) override
 Decimal value of being-aggregated argument. More...
 
double arg_val_real () override
 Floating point value of being-aggregated argument. More...
 
bool arg_is_null (bool use_null_value) override
 NULLness of being-aggregated argument. More...
 
- Public Member Functions inherited from Aggregator
 Aggregator (Item_sum *arg)
 
virtual ~Aggregator ()=default
 

Additional Inherited Members

- Public Types inherited from Aggregator
enum  Aggregator_type { SIMPLE_AGGREGATOR , DISTINCT_AGGREGATOR }
 
- Protected Attributes inherited from Aggregator
Item_sumitem_sum
 

Detailed Description

The pass-through aggregator.

Implements AGGFN (DISTINCT ..) by knowing it gets distinct data on input. So it just pumps them back to the Item_sum descendant class.

Constructor & Destructor Documentation

◆ Aggregator_simple()

Aggregator_simple::Aggregator_simple ( Item_sum sum)
inline

Member Function Documentation

◆ add()

bool Aggregator_simple::add ( )
inlineoverridevirtual

Called when there's a new value to be aggregated.

Updates the internal state of the aggregator to reflect the new value.

Implements Aggregator.

◆ Aggrtype()

Aggregator_type Aggregator_simple::Aggrtype ( )
inlineoverridevirtual

Implements Aggregator.

◆ arg_is_null()

bool Aggregator_simple::arg_is_null ( bool  use_null_value)
overridevirtual

NULLness of being-aggregated argument.

Parameters
use_null_valueOptimization: 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*()).

Implements Aggregator.

◆ arg_val_decimal()

my_decimal * Aggregator_simple::arg_val_decimal ( my_decimal value)
overridevirtual

Decimal value of being-aggregated argument.

Implements Aggregator.

◆ arg_val_real()

double Aggregator_simple::arg_val_real ( )
overridevirtual

Floating point value of being-aggregated argument.

Implements Aggregator.

◆ clear()

void Aggregator_simple::clear ( )
inlineoverridevirtual

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.

Implements Aggregator.

◆ endup()

void Aggregator_simple::endup ( )
inlineoverridevirtual

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.

Implements Aggregator.

◆ setup()

bool Aggregator_simple::setup ( THD )
inlineoverridevirtual

Called before adding the first row.

Allocates and sets up the internal aggregation structures used, e.g. the Unique instance used to calculate distinct.

Implements Aggregator.


The documentation for this class was generated from the following files: