My Project
Public Member Functions | Public Attributes
Create_field Class Reference
Inheritance diagram for Create_field:
Sql_alloc

List of all members.

Public Member Functions

 Create_field (Field *field, Field *orig_field)
Create_fieldclone (MEM_ROOT *mem_root) const
void create_length_to_internal_length (void)
void init_for_tmp_table (enum_field_types sql_type_arg, uint32 max_length, uint32 decimals, bool maybe_null, bool is_unsigned, uint pack_length=~0U)
bool init (THD *thd, const char *field_name, enum_field_types type, const char *length, const char *decimals, uint type_modifier, Item *default_value, Item *on_update_value, LEX_STRING *comment, const char *change, List< String > *interval_list, const CHARSET_INFO *cs, uint uint_geom_type)
ha_storage_media field_storage_type () const
column_format_type column_format () const

Public Attributes

const char * field_name
const char * change
const char * after
LEX_STRING comment
Itemdef
enum enum_field_types sql_type
ulong length
uint32 char_length
uint decimals
uint flags
uint pack_length
uint key_length
Field::utype unireg_check
TYPELIB * interval
TYPELIB * save_interval
List< Stringinterval_list
const CHARSET_INFO * charset
Field::geometry_type geom_type
Fieldfield
uint8 row
uint8 col
uint8 sc_length
uint8 interval_id
uint offset
uint pack_flag

Constructor & Destructor Documentation

Create_field::Create_field ( Field old_field,
Field orig_field 
)

Constructs a column definition from an actual column object. This is a reverse-engineering procedure that creates a column definition object as produced by the parser (Create_field) from a resolved column object (Field).

Parameters:
old_fieldThe column object from which the column definition is constructed.
orig_fieldUsed for copying default values. This parameter may be NULL, but if present it is used for copying default values.

Default values are copied into an Item_string unless:

  • The default value is a function.
  • There is no default value.
  • old_field is a BLOB column.
  • old_field has its data pointer improperly initialized.

Member Function Documentation

Convert create_field::length from number of characters to number of bytes.

bool Create_field::init ( THD *  thd,
const char *  fld_name,
enum_field_types  fld_type,
const char *  fld_length,
const char *  fld_decimals,
uint  fld_type_modifier,
Item fld_default_value,
Item fld_on_update_value,
LEX_STRING *  fld_comment,
const char *  fld_change,
List< String > *  fld_interval_list,
const CHARSET_INFO *  fld_charset,
uint  fld_geom_type 
)

Initialize a column definition object. Column definition objects can be used to construct Field objects.

Parameters:
thdSession/Thread handle.
fld_nameColumn name.
fld_typeColumn type.
fld_lengthColumn length.
fld_decimalsNumber of digits to the right of the decimal point (if any.)
fld_type_modifierAdditional type information.
fld_default_valueColumn default expression (if any.)
fld_on_update_valueThe expression in the ON UPDATE clause.
fld_commentColumn comment.
fld_changeColumn change.
fld_interval_listInterval list (if any.)
fld_charsetColumn charset.
fld_geom_typeColumn geometry type (if any.)
Return values:
FALSEon success.
TRUEon error.
void Create_field::init_for_tmp_table ( enum_field_types  sql_type_arg,
uint32  length_arg,
uint32  decimals_arg,
bool  maybe_null,
bool  is_unsigned,
uint  pack_length_arg = ~0U 
)

Init for a tmp table field. To be extended if need be.


Member Data Documentation

The declared default value, if any, otherwise NULL. Note that this member is NULL if the default is a function. If the column definition has a function declared as the default, the information is found in Create_field::unireg_check.

See also:
Create_field::unireg_check

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