drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::Item_sum_avg Class Reference
Inheritance diagram for drizzled::Item_sum_avg:
[legend]
Collaboration diagram for drizzled::Item_sum_avg:
[legend]

Public Member Functions

 Item_sum_avg (Item *item_par)
 Item_sum_avg (Session *session, Item_sum_avg *item)
void fix_length_and_dec ()
enum Sumfunctype sum_func () const
void clear ()
bool add ()
double val_real ()
int64_t val_int ()
type::Decimal * val_decimal (type::Decimal *)
String * val_str (String *str)
void reset_field ()
void update_field ()
Item * result_item (Field *)
void no_rows_in_result ()
const char * func_name () const
Item * copy_or_same (Session *session)
Field * create_tmp_field (bool group, Table *table, uint32_t convert_blob_length)
void cleanup ()
Public Member Functions inherited from drizzled::Item_sum_sum
 Item_sum_sum (Item *item_par)
 Item_sum_sum (Session *session, Item_sum_sum *item)
enum Sumfunctype sum_func () const
void clear ()
bool add ()
double val_real ()
int64_t val_int ()
String * val_str (String *str)
type::Decimal * val_decimal (type::Decimal *)
enum Item_result result_type () const
void reset_field ()
void update_field ()
void no_rows_in_result ()
const char * func_name () const
Item * copy_or_same (Session *session)
Public Member Functions inherited from drizzled::Item_sum_num
 Item_sum_num (Item *item_par)
 Item_sum_num (Item *a, Item *b)
 Item_sum_num (List< Item > &list)
 Item_sum_num (Session *session, Item_sum_num *item)
bool fix_fields (Session *, Item **)
Public Member Functions inherited from drizzled::Item_sum
void mark_as_sum_func ()
 Item_sum (Item *a)
 Item_sum (Item *a, Item *b)
 Item_sum (List< Item > &list)
 Item_sum (Session *session, Item_sum *item)
enum Type type () const
bool reset ()
virtual bool keep_field_type (void) const
table_map used_tables () const
void update_used_tables ()
bool is_null ()
void make_const ()
virtual bool const_item () const
virtual bool const_during_execution () const
void make_field (SendField *field)
virtual void print (String *str)
void fix_num_length_and_dec ()
virtual bool setup (Session *)
virtual void make_unique (void)
Item * get_tmp_table_item (Session *session)
bool walk (Item_processor processor, bool walk_subquery, unsigned char *argument)
bool init_sum_func_check (Session *session)
bool check_sum_func (Session *session, Item **ref)
bool register_sum_func (Session *session, Item **ref)
Select_Lex * depended_from ()
Public Member Functions inherited from drizzled::Item_result_field
 Item_result_field (Session *session, Item_result_field *item)
Field * get_tmp_table_field ()
Field * tmp_table_field (Table *)
void set_result_field (Field *field)
bool is_result_field ()
void save_in_result_field (bool no_conversions)
Public Member Functions inherited from drizzled::Item
bool is_unsigned () const
virtual bool negative () const
 Item ()
 Item (Session *session, Item *item)
void set_name (str_ref arg)
void set_name (const char *arg)
void set_name (const char *str, uint32_t length, const charset_info_st *cs=system_charset_info)
void init_make_field (SendField *tmp_field, enum_field_types type)
Field * make_string_field (Table *table)
virtual void fix_after_pullout (Select_Lex *new_parent, Item **ref)
void quick_fix_field ()
virtual int save_in_field (Field *field, bool no_conversions)
virtual void save_org_in_field (Field *field)
virtual int save_safe_in_field (Field *field)
virtual void send (plugin::Client *client, String *str)
virtual bool eq (const Item *, bool binary_cmp) const
virtual Item_result cast_to_int_type () const
virtual enum_field_types string_field_type () const
virtual enum_field_types field_type () const
virtual int64_t val_int_endpoint (bool left_endp, bool *incl_endp)
uint64_t val_uint ()
virtual bool val_bool ()
String * val_string_from_real (String *str)
String * val_string_from_int (String *str)
String * val_string_from_decimal (String *str)
type::Decimal * val_decimal_from_real (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_int (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_string (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_date (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_time (type::Decimal *decimal_value)
int64_t val_int_from_decimal ()
double val_real_from_decimal ()
bool save_time_in_field (Field *field)
bool save_date_in_field (Field *field)
int save_str_value_in_field (Field *field, String *result)
virtual const char * full_name (void) const
virtual double val_result ()
virtual int64_t val_int_result ()
virtual String * str_result (String *tmp)
virtual type::Decimal * val_decimal_result (type::Decimal *val)
virtual bool val_bool_result ()
virtual table_map not_null_tables () const
virtual bool basic_const_item () const
virtual Item * clone_item ()
virtual cond_result eq_cmp_result () const
uint32_t float_length (uint32_t decimals_par) const
virtual uint32_t decimal_precision () const
int decimal_int_part () const
void print_item_w_name (String *)
virtual void split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields)
void split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered)
virtual bool get_date (type::Time &ltime, uint32_t fuzzydate)
virtual bool get_time (type::Time &ltime)
virtual bool get_date_result (type::Time &ltime, uint32_t fuzzydate)
virtual void update_null_value ()
virtual void top_level_item (void)
virtual bool is_bool_func (void)
virtual Item * copy_andor_structure (Session *session)
virtual Item * real_item (void)
virtual const Item * real_item (void) const
virtual const charset_info_st * compare_collation ()
virtual Item * transform (Item_transformer transformer, unsigned char *arg)
virtual Item * compile (Item_analyzer analyzer, unsigned char **arg_p, Item_transformer transformer, unsigned char *arg_t)
virtual void traverse_cond (Cond_traverser traverser, void *arg, traverse_order order)
virtual bool remove_dependence_processor (unsigned char *arg)
virtual bool collect_item_field_processor (unsigned char *arg)
virtual bool find_item_in_field_list_processor (unsigned char *arg)
virtual bool change_context_processor (unsigned char *context)
virtual bool register_field_in_read_map (unsigned char *arg)
virtual bool subst_argument_checker (unsigned char **arg)
virtual bool cache_const_expr_analyzer (unsigned char **arg)
virtual Item * cache_const_expr_transformer (unsigned char *arg)
virtual Item * equal_fields_propagator (unsigned char *arg)
virtual bool set_no_const_sub (unsigned char *arg)
virtual Item * replace_equal_field (unsigned char *arg)
virtual uint32_t cols ()
virtual Item * element_index (uint32_t i)
virtual Item ** addr (uint32_t i)
virtual bool check_cols (uint32_t c)
virtual bool null_inside ()
virtual void bring_value ()
Field * tmp_table_field_from_field_type (Table *table, bool fixed_length)
virtual Item * neg_transformer (Session *session)
virtual Item * update_value_transformer (unsigned char *select_arg)
virtual Item * safe_charset_converter (const charset_info_st *const tocs)
void delete_self ()
virtual bool result_as_int64_t ()
bool is_datetime ()
virtual bool is_expensive ()
String * check_well_formed_result (String *str, bool send_error=0)
bool eq_by_collation (Item *item, bool binary_cmp, const charset_info_st *const cs)
uint32_t char_to_byte_length_safe (uint32_t char_length_arg, uint32_t mbmaxlen_arg)
uint32_t max_char_length () const
void fix_char_length (uint32_t max_char_length_arg)

Public Attributes

uint64_t count
uint32_t prec_increment
uint32_t f_precision
uint32_t f_scale
uint32_t dec_bin_size
Public Attributes inherited from drizzled::Item_sum
Item ** args
Item * tmp_args [2]
Item ** ref_by
Item_sum * next
uint32_t arg_count
Item_sum * in_sum_func
Select_Lex * aggr_sel
int8_t nest_level
int8_t aggr_level
int8_t max_arg_level
int8_t max_sum_func_level
bool quick_group
List< Item_field > outer_fields
Public Attributes inherited from drizzled::Item_result_field
Field * result_field
Public Attributes inherited from drizzled::Item
String str_value
const char * name
uint32_t name_length
Item * next
uint32_t max_length
int8_t marker
uint8_t decimals
bool fixed
bool maybe_null
bool null_value
bool unsigned_flag
bool with_sum_func
bool is_autogenerated_name
bool with_subselect
DTCollation collation
Item_result cmp_context

Additional Inherited Members

Public Types inherited from drizzled::Item_sum
enum  Sumfunctype {
  COUNT_FUNC , COUNT_DISTINCT_FUNC , SUM_FUNC , SUM_DISTINCT_FUNC ,
  AVG_FUNC , AVG_DISTINCT_FUNC , MIN_FUNC , MAX_FUNC ,
  STD_FUNC , VARIANCE_FUNC , SUM_BIT_FUNC , GROUP_CONCAT_FUNC
}
Public Types inherited from drizzled::Item
enum  Type {
  FIELD_ITEM = 0 , FUNC_ITEM , SUM_FUNC_ITEM , STRING_ITEM ,
  INT_ITEM , REAL_ITEM , NULL_ITEM , VARBIN_ITEM ,
  COPY_STR_ITEM , FIELD_AVG_ITEM , DEFAULT_VALUE_ITEM , PROC_ITEM ,
  COND_ITEM , REF_ITEM , FIELD_STD_ITEM , FIELD_VARIANCE_ITEM ,
  INSERT_VALUE_ITEM , SUBSELECT_ITEM , ROW_ITEM , CACHE_ITEM ,
  TYPE_HOLDER , PARAM_ITEM , BOOLEAN_ITEM , DECIMAL_ITEM
}
enum  traverse_order { T_POSTFIX , T_PREFIX }
enum  cond_result { COND_UNDEF , COND_OK , COND_TRUE , COND_FALSE }
Static Public Member Functions inherited from drizzled::Item
static const charset_info_st * default_charset ()
Static Public Member Functions inherited from drizzled::memory::SqlAlloc
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void * operator new (size_t size, Root &root)
static void * operator new[] (size_t size, Root &root)
static void * operator new (size_t size, Root *root)
static void * operator new[] (size_t size, Root *root)
static void operator delete (void *)
static void operator delete[] (void *)
static void operator delete (void *, Root &)
static void operator delete[] (void *, Root &)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)
Protected Member Functions inherited from drizzled::Item_sum_sum
void fix_length_and_dec ()
Protected Member Functions inherited from drizzled::Item
Session & getSession ()
Protected Attributes inherited from drizzled::Item_sum_sum
Item_result hybrid_type
double sum
type::Decimal dec_buffs [2]
uint32_t curr_dec_buff
Protected Attributes inherited from drizzled::Item_sum_num
bool is_evaluated
Protected Attributes inherited from drizzled::Item_sum
table_map used_tables_cache
bool forced_const

Detailed Description

Definition at line 661 of file item/sum.h.

Constructor & Destructor Documentation

◆ Item_sum_avg() [1/2]

drizzled::Item_sum_avg::Item_sum_avg ( Item * item_par)
inline

Definition at line 668 of file item/sum.h.

◆ Item_sum_avg() [2/2]

drizzled::Item_sum_avg::Item_sum_avg ( Session * session,
Item_sum_avg * item )
inline

Definition at line 669 of file item/sum.h.

Member Function Documentation

◆ add()

bool drizzled::Item_sum_avg::add ( )
virtual

Implements drizzled::Item_sum.

Definition at line 1285 of file item/sum.cc.

◆ cleanup()

void drizzled::Item_sum_avg::cleanup ( )
inlinevirtual

Reimplemented from drizzled::Item_sum.

Definition at line 690 of file item/sum.h.

◆ clear()

void drizzled::Item_sum_avg::clear ( )
virtual

Implements drizzled::Item_sum.

Definition at line 1278 of file item/sum.cc.

◆ copy_or_same()

Item * drizzled::Item_sum_avg::copy_or_same ( Session * session)
virtual

Reimplemented from drizzled::Item.

Definition at line 1245 of file item/sum.cc.

◆ create_tmp_field()

Field * drizzled::Item_sum_avg::create_tmp_field ( bool group,
Table * table,
uint32_t convert_blob_length )
virtual

Reimplemented from drizzled::Item_sum.

Definition at line 1251 of file item/sum.cc.

◆ fix_length_and_dec()

void drizzled::Item_sum_avg::fix_length_and_dec ( )
virtual

Reimplemented from drizzled::Item_sum.

Definition at line 1222 of file item/sum.cc.

◆ func_name()

const char * drizzled::Item_sum_avg::func_name ( ) const
inlinevirtual

Implements drizzled::Item_sum.

Definition at line 687 of file item/sum.h.

◆ no_rows_in_result()

void drizzled::Item_sum_avg::no_rows_in_result ( void )
inlinevirtual

Sets value of aggregate function in case of no rows for grouping were found

Reimplemented from drizzled::Item_sum.

Definition at line 686 of file item/sum.h.

◆ reset_field()

void drizzled::Item_sum_avg::reset_field ( )
virtual

Implements drizzled::Item_sum.

Definition at line 2067 of file item/sum.cc.

◆ result_item()

Item * drizzled::Item_sum_avg::result_item ( Field * )
inlinevirtual

Reimplemented from drizzled::Item_sum.

Definition at line 684 of file item/sum.h.

◆ sum_func()

enum Sumfunctype drizzled::Item_sum_avg::sum_func ( ) const
inlinevirtual

Implements drizzled::Item_sum.

Definition at line 674 of file item/sum.h.

◆ update_field()

void drizzled::Item_sum_avg::update_field ( )
virtual

Implements drizzled::Item_sum.

Definition at line 2171 of file item/sum.cc.

◆ val_decimal()

type::Decimal * drizzled::Item_sum_avg::val_decimal ( type::Decimal * decimal_buffer)
virtual

Return decimal representation of item with fixed point.

Parameters
bufferwhich can be used by Item for returning value (but can be not)
Note

Returned value should not be changed if it is not the same which was passed via argument.

Return values
Returnpointer on type::Decimal (it can be other then passed via argument) if value is not NULL (null_value flag will be reset to false). In case of NULL value it return 0 pointer and set null_value flag to true.

Implements drizzled::Item.

Definition at line 1312 of file item/sum.cc.

◆ val_int()

int64_t drizzled::Item_sum_avg::val_int ( )
virtual

Returns integer representation of item.

Return values
Incase of NULL value return 0 and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 1306 of file item/sum.cc.

◆ val_real()

double drizzled::Item_sum_avg::val_real ( )
virtual

Returns double precision floating point representation of item.

Return values
Incase of NULL value return 0.0 and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 1294 of file item/sum.cc.

◆ val_str()

String * drizzled::Item_sum_avg::val_str ( String * str)
virtual

Return string representation of this item object.

Parameters
anallocated buffer this or any nested Item object can use to store return value of this method.
Note

Buffer passed via argument should only be used if the item itself doesn't have an own String buffer. In case when the item maintains it's own string buffer, it's preferable to return it instead to minimize number of mallocs/memcpys.

The caller of this method can modify returned string, but only in case when it was allocated on heap, (is_alloced() is true). This allows the caller to efficiently use a buffer allocated by a child without having to allocate a buffer of it's own. The buffer, given to val_str() as argument, belongs to the caller and is later used by the caller at it's own choosing.

A few implications from the above:

  • unless you return a string object which only points to your buffer but doesn't manages it you should be ready that it will be modified.
  • even for not allocated strings (is_alloced() == false) the caller can change charset (see Item_func_{typecast/binary}. XXX: is this a bug?
  • still you should try to minimize data copying and return internal object whenever possible.
Return values
Incase of NULL value return 0 (NULL pointer) and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 1337 of file item/sum.cc.

Member Data Documentation

◆ count

uint64_t drizzled::Item_sum_avg::count

Definition at line 664 of file item/sum.h.

◆ dec_bin_size

uint32_t drizzled::Item_sum_avg::dec_bin_size

Definition at line 666 of file item/sum.h.

◆ f_precision

uint32_t drizzled::Item_sum_avg::f_precision

Definition at line 666 of file item/sum.h.

◆ f_scale

uint32_t drizzled::Item_sum_avg::f_scale

Definition at line 666 of file item/sum.h.

◆ prec_increment

uint32_t drizzled::Item_sum_avg::prec_increment

Definition at line 665 of file item/sum.h.


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