918
918
return 0; // This shouldn't happen
921
Field *TableShare::make_field(memory::Root *root,
923
uint32_t field_length,
925
unsigned char *null_pos,
926
unsigned char null_bit,
928
enum_field_types field_type,
929
const CHARSET_INFO * field_charset,
930
Field::utype unireg_check,
932
const char *field_name)
934
TableShare *share= this;
944
null_bit= ((unsigned char) 1) << null_bit;
949
case DRIZZLE_TYPE_DATE:
950
case DRIZZLE_TYPE_DATETIME:
951
case DRIZZLE_TYPE_TIMESTAMP:
952
field_charset= &my_charset_bin;
956
if (field_type == DRIZZLE_TYPE_VARCHAR ||
957
field_type == DRIZZLE_TYPE_BLOB ||
958
field_type == DRIZZLE_TYPE_ENUM)
960
if (field_type == DRIZZLE_TYPE_VARCHAR)
961
return new (root) Field_varstring(ptr,field_length,
962
HA_VARCHAR_PACKLENGTH(field_length),
968
if (field_type == DRIZZLE_TYPE_BLOB)
970
return new (root) Field_blob(ptr,
975
calc_pack_length(DRIZZLE_TYPE_LONG, 0),
981
return new (root) Field_enum(ptr,
986
get_enum_pack_length(interval->count),
994
case DRIZZLE_TYPE_DECIMAL:
995
return new (root) Field_decimal(ptr,
1003
false /* is_unsigned */);
1004
case DRIZZLE_TYPE_DOUBLE:
1005
return new (root) Field_double(ptr,
1013
false /* is_unsigned */);
1014
case DRIZZLE_TYPE_LONG:
1015
return new (root) Field_long(ptr,
1022
false /* is_unsigned */);
1023
case DRIZZLE_TYPE_LONGLONG:
1024
return new (root) Field_int64_t(ptr,
1031
false /* is_unsigned */);
1032
case DRIZZLE_TYPE_TIMESTAMP:
1033
return new (root) Field_timestamp(ptr,
1041
case DRIZZLE_TYPE_DATE:
1042
return new (root) Field_date(ptr,
1047
case DRIZZLE_TYPE_DATETIME:
1048
return new (root) Field_datetime(ptr,
1053
case DRIZZLE_TYPE_NULL:
1054
return new (root) Field_null(ptr,
1058
default: // Impossible (Wrong version)
1064
921
/*****************************************************************************
1065
922
Warning handling
1066
923
*****************************************************************************/