My Project
Public Member Functions
Item_string Class Reference
Inheritance diagram for Item_string:
Item_basic_constant Item Item_partition_func_safe_string Item_static_string_func Item_blob Item_empty_string

List of all members.

Public Member Functions

 Item_string (const char *str, uint length, const CHARSET_INFO *cs, Derivation dv=DERIVATION_COERCIBLE, uint repertoire=MY_REPERTOIRE_UNICODE30)
 Item_string (const CHARSET_INFO *cs, Derivation dv=DERIVATION_COERCIBLE)
 Item_string (const Name_string name_par, const char *str, uint length, const CHARSET_INFO *cs, Derivation dv=DERIVATION_COERCIBLE, uint repertoire=MY_REPERTOIRE_UNICODE30)
void set_str_with_copy (const char *str_arg, uint length_arg)
void set_repertoire_from_value ()
enum Type type () const
double val_real ()
longlong val_int ()
Stringval_str (String *)
my_decimalval_decimal (my_decimal *)
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
type_conversion_status save_in_field (Field *field, bool no_conversions)
enum Item_result result_type () const
enum_field_types field_type () const
bool basic_const_item () const
bool eq (const Item *item, bool binary_cmp) const
Itemclone_item ()
Itemsafe_charset_converter (const CHARSET_INFO *tocs)
Itemcharset_converter (const CHARSET_INFO *tocs, bool lossless)
void append (char *str, uint length)
virtual void print (String *str, enum_query_type query_type)
bool check_partition_func_processor (uchar *int_arg)
bool is_cs_specified () const
void set_cs_specified (bool cs_specified)

Member Function Documentation

Item * Item_string::charset_converter ( const CHARSET_INFO *  tocs,
bool  lossless 
)

Convert a string item into the requested character set.

Parameters:
tocsCharacter set to to convert the string to.
losslessWhether data loss is acceptable.
Returns:
A new item representing the converted string.
bool Item_string::eq ( const Item item,
bool  binary_cmp 
) const [virtual]

This function is called when:

  • Comparing items in the WHERE clause (when doing where optimization)
  • When trying to find an ORDER BY/GROUP BY item in the SELECT part
  • When matching fields in multiple equality objects (Item_equal)

Reimplemented from Item.

bool Item_string::is_cs_specified ( ) const [inline]

Return TRUE if character-set-introducer was explicitly specified in the original query for this item (text literal).

This operation is to be called from Item_string::print(). The idea is that when a query is generated (re-constructed) from the Item-tree, character-set-introducers should appear only for those literals, where they were explicitly specified by the user. Otherwise, that may lead to loss collation information (character set introducers implies default collation for the literal).

Basically, that makes sense only for views and hopefully will be gone one day when we start using original query as a view definition.

Returns:
This operation returns the value of m_cs_specified attribute.
Return values:
TRUEif character set introducer was explicitly specified in the original query.
FALSEotherwise.
void Item_string::print ( String str,
enum_query_type  query_type 
) [virtual]
See also:
enum_query_type. For us to be able to print a query (in debugging, optimizer trace, EXPLAIN EXTENDED) without changing the query's result, this function must not modify the item's content. Not even a realloc() of str_value is permitted: Item_func_concat/repeat/encode::val_str() depend on the allocated length; a change of this length can influence results of CONCAT(), REPEAT(), ENCODE()...

Reimplemented from Item.

Reimplemented in Item_static_string_func.

type_conversion_status Item_string::save_in_field ( Field field,
bool  no_conversions 
) [virtual]

Save a temporal value in packed longlong format into a Field. Used in optimizer.

Parameters:
OUTfield The field to set the value to.
Return values:
0On success.
>0In error.

Reimplemented from Item.

void Item_string::set_cs_specified ( bool  cs_specified) [inline]

Set the value of m_cs_specified attribute.

m_cs_specified attribute shows whether character-set-introducer was explicitly specified in the original query for this text literal or not. The attribute makes sense (is used) only for views.

This operation is to be called from the parser during parsing an input query.

longlong Item_string::val_int ( void  ) [virtual]
Todo:
Give error if we wanted a signed integer and we got an unsigned one

Implements Item.


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