My Project
Public Member Functions | Protected Attributes | Friends
Field_str Class Reference
Inheritance diagram for Field_str:
Field Field_enum Field_longstr Field_null Field_set Field_blob Field_string Field_varstring

List of all members.

Public Member Functions

 Field_str (uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg, const CHARSET_INFO *charset)
Item_result result_type () const
Item_result numeric_context_result_type () const
uint decimals () const
void make_field (Send_field *field)
type_conversion_status store (double nr)
type_conversion_status store (longlong nr, bool unsigned_val)=0
type_conversion_status store_decimal (const my_decimal *)
type_conversion_status store (const char *to, uint length, const CHARSET_INFO *cs)=0
uint repertoire (void) const
const CHARSET_INFO * charset (void) const
void set_charset (const CHARSET_INFO *charset_arg)
enum Derivation derivation (void) const
virtual void set_derivation (enum Derivation derivation_arg)
bool binary () const
uint32 max_display_length ()
virtual bool str_needs_quotes ()
uint is_equal (Create_field *new_field)

Protected Attributes

const CHARSET_INFO * field_charset
enum Derivation field_derivation

Friends

class Create_field

Member Function Documentation

uint Field_str::is_equal ( Create_field new_field) [virtual]

Whether a field being created is compatible with a existing one.

Used by the ALTER TABLE code to evaluate whether the new definition of a table is compatible with the old definition so that it can determine if data needs to be copied over (table data change).

Reimplemented from Field.

Reimplemented in Field_blob, and Field_varstring.

Item_result Field_str::numeric_context_result_type ( ) const [inline, virtual]

Returns Item_result type of a field when it appears in numeric context such as: SELECT time_column + 1; SELECT SUM(time_column); Examples:

  • a column of type TIME, DATETIME, TIMESTAMP act as INT.
  • a column of type TIME(1), DATETIME(1), TIMESTAMP(1) act as DECIMAL with 1 fractional digits.

Reimplemented from Field.

type_conversion_status Field_str::store ( double  nr) [virtual]

Store double value in Field_string or Field_varstring.

Pretty prints double number into field_length characters buffer.

Parameters:
nrnumber

Implements Field.

Reimplemented in Field_set, Field_enum, Field_blob, Field_varstring, Field_string, and Field_null.

type_conversion_status Field_str::store_decimal ( const my_decimal d) [virtual]

Decimal representation of Field_str.

Parameters:
dvalue for storing
Note:
Field_str is the base class for fields implemeting [VAR]CHAR, VAR[BINARY], BLOB/TEXT, GEOMETRY. String value should be converted to floating point value according our rules, so we use double to store value of decimal in string.
Todo:
use decimal2string?
Return values:
0OK
!=0error

Implements Field.

Reimplemented in Field_null, and Field_longstr.


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