My Project
Public Member Functions | Friends
Item_func_group_concat Class Reference
Inheritance diagram for Item_func_group_concat:
Item_sum Item_result_field Item

List of all members.

Public Member Functions

 Item_func_group_concat (Name_resolution_context *context_arg, bool is_distinct, List< Item > *is_select, const SQL_I_List< ORDER > &is_order, String *is_separator)
 Item_func_group_concat (THD *thd, Item_func_group_concat *item)
void cleanup ()
enum Sumfunctype sum_func () const
const char * func_name () const
virtual Item_result result_type () const
virtual Fieldmake_string_field (TABLE *table)
enum_field_types field_type () const
void clear ()
bool add ()
void reset_field ()
void update_field ()
bool fix_fields (THD *, Item **)
bool setup (THD *thd)
void make_unique ()
double val_real ()
longlong val_int ()
my_decimalval_decimal (my_decimal *decimal_value)
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
Stringval_str (String *str)
Itemcopy_or_same (THD *thd)
void no_rows_in_result ()
virtual void print (String *str, enum_query_type query_type)
virtual bool change_context_processor (uchar *cntx)

Friends

int group_concat_key_cmp_with_distinct (const void *arg, const void *key1, const void *key2)
int group_concat_key_cmp_with_order (const void *arg, const void *key1, const void *key2)
int dump_leaf_key (void *key_arg, element_count count __attribute__((unused)), void *item_arg)

Constructor & Destructor Documentation

Item_func_group_concat::Item_func_group_concat ( Name_resolution_context context_arg,
bool  distinct_arg,
List< Item > *  select_list,
const SQL_I_List< ORDER > &  order_list,
String separator_arg 
)

Constructor of Item_func_group_concat.

Parameters:
distinct_argdistinct
select_listlist of expression for show values
order_listlist of sort columns
separator_argstring value of separator.

Member Function Documentation

Create a field to hold a string value from an item.

If max_length > CONVERT_IF_BIGGER_TO_BLOB create a blob
If max_length > 0 create a varchar
If max_length == 0 create a CHAR(0) (or VARCHAR(0) if we are grouping)

Parameters:
tableTable for which the field is created

Reimplemented from Item.

void Item_func_group_concat::no_rows_in_result ( ) [inline, virtual]

Mark an aggregate as having no rows.

This function is called by the execution engine to assign 'NO ROWS FOUND' value to an aggregate item, when the underlying result set has no rows. Such value, in a general case, may be different from the default value of the item after 'clear()': e.g. a numeric item may be initialized to 0 by clear() and to NULL by no_rows_in_result().

Reimplemented from Item_sum.

void Item_func_group_concat::print ( String str,
enum_query_type  query_type 
) [virtual]

This method is used for to:

  • to generate a view definition query (SELECT-statement);
  • to generate a SQL-query for EXPLAIN EXTENDED;
  • to generate a SQL-query to be shown in INFORMATION_SCHEMA;
  • debug.

For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,

See also:
mysql_register_view().

Reimplemented from Item_sum.

bool Item_func_group_concat::setup ( THD *  thd) [virtual]

Initialize blob_storage if GROUP_CONCAT is used with ORDER BY | DISTINCT and BLOB field count > 0.

Reimplemented from Item_sum.


Friends And Related Function Documentation

int dump_leaf_key ( void *  key_arg,
element_count count   __attribute__(unused),
void *  item_arg 
) [friend]

Append data from current leaf to item->result.

To avoid duplicated warnings in Item_func_group_concat::val_str()

int group_concat_key_cmp_with_distinct ( const void *  arg,
const void *  key1,
const void *  key2 
) [friend]

Compares the values for fields in expr list of GROUP_CONCAT.

Note:

GROUP_CONCAT([DISTINCT] expr [,expr ...] [ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_name ...]] [SEPARATOR str_val])

Returns:
Return values:
-1: key1 < key2
0: key1 = key2
1: key1 > key2
int group_concat_key_cmp_with_order ( const void *  arg,
const void *  key1,
const void *  key2 
) [friend]

function of sort for syntax: GROUP_CONCAT(expr,... ORDER BY col,... )


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines