drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::CreateField Class Reference

#include <create_field.h>

Inheritance diagram for drizzled::CreateField:
[legend]
Collaboration diagram for drizzled::CreateField:
[legend]

Public Member Functions

enum_field_types type () const
 CreateField (Field *field, Field *orig_field)
void create_length_to_internal_length (void)
enum column_format_type column_format () const
void init_for_tmp_table (enum_field_types sql_type_arg, uint32_t max_length, uint32_t decimals, bool maybe_null)
bool init (Session *, const char *field_name, enum_field_types type, const char *length, const char *decimals, uint32_t type_modifier, str_ref comment, const char *change, List< String > *interval_list, const charset_info_st *, uint32_t uint_geom_type, column_format_type column_format)
bool setDefaultValue (Item *default_value, Item *on_update_item)

Public Attributes

const char * field_name = nullptr
const char * change = nullptr
const char * after = nullptr
str_ref comment
Item * def = nullptr
enum_field_types sql_type = enum_field_types()
uint32_t length = 0
TYPELIB * interval = nullptr
List< String > interval_list
const charset_info_st * charset = nullptr
Field * field = nullptr
uint8_t interval_id = 0
uint32_t offset = 0

Additional Inherited Members

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 *)

Detailed Description

Class representing a field in a CREATE TABLE statement.

Basically, all information for a new or altered field definition is contained in the Create_field class.

Definition at line 32 of file create_field.h.

Constructor & Destructor Documentation

◆ CreateField()

drizzled::CreateField::CreateField ( Field * old_field,
Field * orig_field )

Create a field suitable for create of table.

Definition at line 63 of file create_field.cc.

Member Function Documentation

◆ column_format()

enum column_format_type drizzled::CreateField::column_format ( ) const
inline

Definition at line 74 of file create_field.h.

◆ create_length_to_internal_length()

void drizzled::CreateField::create_length_to_internal_length ( void )

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

Definition at line 131 of file create_field.cc.

◆ init()

bool drizzled::CreateField::init ( Session * ,
const char * field_name,
enum_field_types type,
const char * length,
const char * decimals,
uint32_t type_modifier,
str_ref comment,
const char * change,
List< String > * interval_list,
const charset_info_st * fld_charset,
uint32_t uint_geom_type,
column_format_type column_format )

Initialize field definition for create.

Parameters
sessionThread handle
fld_nameField name
fld_typeField type
fld_lengthField length
fld_decimalsDecimal (if any)
fld_type_modifierAdditional type information
fld_default_valueField default value (if any)
fld_on_update_valueThe value of ON UPDATE clause
fld_commentField comment
fld_changeField change
fld_interval_listInterval list (if any)
fld_charsetField charset
Return values
falseon success
trueon error

Definition at line 179 of file create_field.cc.

◆ init_for_tmp_table()

void drizzled::CreateField::init_for_tmp_table ( enum_field_types sql_type_arg,
uint32_t length_arg,
uint32_t decimals_arg,
bool maybe_null )

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

Note
This is currently ONLY used in Item_sum_distinct::setup()

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

Definition at line 163 of file create_field.cc.

◆ setDefaultValue()

bool drizzled::CreateField::setDefaultValue ( Item * default_value,
Item * on_update_item )

Definition at line 342 of file create_field.cc.

◆ type()

enum_field_types drizzled::CreateField::type ( ) const
inline

Definition at line 42 of file create_field.h.

Member Data Documentation

◆ after

const char* drizzled::CreateField::after = nullptr

Put this new Field after this Field

Definition at line 37 of file create_field.h.

◆ change

const char* drizzled::CreateField::change = nullptr

If done with alter table

Definition at line 36 of file create_field.h.

◆ charset

const charset_info_st* drizzled::CreateField::charset = nullptr

Character set for the column – @TODO should be deleted

Definition at line 64 of file create_field.h.

◆ comment

str_ref drizzled::CreateField::comment

A comment for this field

Definition at line 38 of file create_field.h.

◆ def

Item* drizzled::CreateField::def = nullptr

Default value for the new field

Definition at line 39 of file create_field.h.

◆ field

Field* drizzled::CreateField::field = nullptr

Definition at line 65 of file create_field.h.

◆ field_name

const char* drizzled::CreateField::field_name = nullptr

Name of the field to be created

Definition at line 35 of file create_field.h.

◆ interval

TYPELIB* drizzled::CreateField::interval = nullptr

The value of `length' as set by parser: is the number of characters for most of the types, or of bytes for BLOBs or numeric types. */ uint32_t char_length= 0; uint32_t decimals= 0; uint32_t flags= 0; uint32_t pack_length= 0; uint32_t key_length= 0; Field::utype unireg_check= Field::utype(); /**< See Field::unireg_check Which interval to use (ENUM types..)

Definition at line 62 of file create_field.h.

◆ interval_id

uint8_t drizzled::CreateField::interval_id = 0

Definition at line 67 of file create_field.h.

◆ interval_list

List<String> drizzled::CreateField::interval_list

Definition at line 63 of file create_field.h.

◆ length

uint32_t drizzled::CreateField::length = 0

At various stages in execution this can be length of field in bytes or max number of characters.

Definition at line 51 of file create_field.h.

◆ offset

uint32_t drizzled::CreateField::offset = 0

Definition at line 68 of file create_field.h.

◆ sql_type

enum_field_types drizzled::CreateField::sql_type = enum_field_types()

The data type of the new field

Definition at line 40 of file create_field.h.


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