65#include "vector-common/vector_constants.h"
119#define portable_sizeof_char_ptr 8
252#define IS_EQUAL_YES 1
253#define IS_EQUAL_PACK_LENGTH 2
255#define my_charset_numeric my_charset_latin1
256#define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII
284 return elements < 256 ? 1 : 2;
288 const uint len = (elements + 7) / 8;
289 return len > 4 ? 8 : len;
331#define ASSERT_COLUMN_MARKED_FOR_READ \
333 (!table->read_set || bitmap_is_set(table->read_set, field_index())))
334#define ASSERT_COLUMN_MARKED_FOR_WRITE \
335 assert(!table || (!table->write_set || \
336 bitmap_is_set(table->write_set, field_index())))
416 switch (pack_length) {
449template <
bool Is_big_endian>
452 if (to_length == 0)
return;
454 std::copy(from, from + std::min(to_length, from_length), to);
456 to[0] =
static_cast<char>(to[0] ^ 128);
458 const uchar *from_end = from + from_length;
459 const uchar *from_start = from_end - std::min(from_length, to_length);
460 std::reverse_copy(from_start, from_end, to);
462 to[0] =
static_cast<char>(to[0] ^ 128);
902 uchar null_bit_arg,
uchar auto_flags_arg,
const char *field_name_arg);
965 return store(nr,
false);
1078 return field_metadata;
1194 uint max_len [[maybe_unused]])
const {
1199 uint32 max_length [[maybe_unused]] = ~0
L)
const {
1285 void set_null(ptrdiff_t row_offset = 0);
1364 size_t trunc_pos [[maybe_unused]])
const {
1386 uchar *new_null_ptr, uint new_null_bit)
const {
1388 field->
move_field(new_ptr, new_null_ptr, new_null_bit);
1393 uchar *new_null_ptr, uint new_null_bit)
const;
1478 return return_value;
1554 uint max_length)
const {
1555 return pack(to, from, max_length);
1581 ulonglong value_options [[maybe_unused]])
const {
1595 void copy_data(ptrdiff_t src_record_offset);
1676 int cut_increment) {
1677 return set_warning(level, code, cut_increment,
nullptr,
nullptr);
1681 int cut_increment,
const char *view_db,
1682 const char *view_name);
1710 bool *has_overflow);
1766 virtual void hash(ulong *nr, ulong *nr2)
const;
1830 KEY *cur_index_info)
const;
1891 [[maybe_unused]])
const {
2019 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2043 size_t length,
const char *int_end,
2107 const char *well_formed_error_pos,
const char *cannot_convert_error_pos,
2108 const char *from_end_pos,
const char *
end,
bool count_spaces,
2114 const char *field_name_arg,
const CHARSET_INFO *charset_arg)
2115 :
Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2116 field_name_arg, charset_arg) {}
2129 TR_POSITIVE_OVERFLOW = 1,
2130 TR_NEGATIVE_OVERFLOW = 2
2135 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2137 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2138 field_name_arg, dec_arg, zero_arg, unsigned_arg),
2159 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2161 :
Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2162 field_name_arg, dec_arg, zero_arg, unsigned_arg) {}
2177 void overflow(
bool negative);
2206 bool m_keep_precision{
false};
2221 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2224 const char *field_name_arg,
uint8 dec_arg,
2231 void set_value_on_overflow(
my_decimal *decimal_value,
bool sign) const;
2256 int *order_var)
const final;
2263 static Field *create_from_item(
const Item *item);
2272 const char *field_name_arg,
bool zero_arg,
bool unsigned_arg)
2273 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2274 field_name_arg, 0, zero_arg, unsigned_arg) {}
2279 field_name_arg, 0, false, unsigned_arg) {}
2304 if (max_length > 0) *to = *from;
2309 uint param_data [[maybe_unused]])
final {
2323 const char *field_name_arg,
bool zero_arg,
bool unsigned_arg)
2324 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2325 field_name_arg, 0, zero_arg, unsigned_arg) {}
2330 field_name_arg, 0, false, unsigned_arg) {}
2332 :
Field_short(len_arg, false, field_name_arg, unsigned_arg) {}
2361 uint param_data [[maybe_unused]])
final {
2374 const char *field_name_arg,
bool zero_arg,
bool unsigned_arg)
2375 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2376 field_name_arg, 0, zero_arg, unsigned_arg) {}
2381 field_name_arg, 0, false, unsigned_arg) {}
2412 static const int PACK_LENGTH = 4;
2416 const char *field_name_arg,
bool zero_arg,
bool unsigned_arg)
2417 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2418 field_name_arg, 0, zero_arg, unsigned_arg) {}
2423 field_name_arg, 0, false, unsigned_arg) {}
2453 uint param_data [[maybe_unused]])
final {
2458 return is_unsigned() ? 0xFFFFFFFFULL : 0x7FFFFFFFULL;
2464 static const int PACK_LENGTH = 8;
2468 const char *field_name_arg,
bool zero_arg,
bool unsigned_arg)
2469 :
Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2470 field_name_arg, 0, zero_arg, unsigned_arg) {}
2472 const char *field_name_arg,
bool unsigned_arg)
2475 field_name_arg, 0, false, unsigned_arg) {}
2504 uint param_data [[maybe_unused]])
final {
2509 return is_unsigned() ? 0xFFFFFFFFFFFFFFFFULL : 0x7FFFFFFFFFFFFFFFULL;
2517 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2519 :
Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2520 field_name_arg, dec_arg, zero_arg, unsigned_arg) {}
2522 uint8 dec_arg,
bool unsigned_arg)
2525 field_name_arg, dec_arg, false, unsigned_arg) {}
2550 return 0x1000000ULL;
2561 const char *field_name_arg,
uint8 dec_arg,
bool zero_arg,
2563 :
Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2564 field_name_arg, dec_arg, zero_arg, unsigned_arg) {}
2569 field_name_arg, dec_arg, false, false) {}
2571 uint8 dec_arg,
bool unsigned_arg)
2574 field_name_arg, dec_arg, false, unsigned_arg) {}
2576 uint8 dec_arg,
bool unsigned_arg,
bool not_fixed_arg)
2579 field_name_arg, dec_arg, false, unsigned_arg) {
2580 not_fixed = not_fixed_arg;
2606 return 0x20000000000000ULL;
2621 field_name_arg,
cs) {}
2809 [[nodiscard]]
bool set_datetime_warning(
2812 int truncate_increment);
2826 uchar auto_flags_arg,
const char *field_name_arg,
2830 ((normalize_dec(dec_arg)) ? normalize_dec(dec_arg) + 1 : 0),
2831 null_ptr_arg, null_bit_arg, auto_flags_arg, field_name_arg) {
2833 dec = normalize_dec(dec_arg);
2862 return date_flags(thd);
2896 return get_date_internal(ltime);
2904 bool get_internal_check_zero(
MYSQL_TIME *ltime,
2915 int *warnings)
final;
2931 const char *field_name_arg,
uint8 int_length_arg,
2933 :
Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
2934 field_name_arg, int_length_arg, dec_arg) {}
2968 const char *field_name_arg,
uint8 dec_arg)
2970 auto_flags_arg, field_name_arg,
2997 void init_timestamp_flags();
3013 bool get_date_internal(
MYSQL_TIME *ltime)
const final;
3014 bool get_date_internal_at_utc(
MYSQL_TIME *ltime)
const final;
3018 void store_timestamp_internal(
const my_timeval *tm)
override;
3031 uchar auto_flags_arg,
const char *field_name_arg,
3082 enum Limits { MIN_YEAR = 1901, MAX_YEAR = 2155 };
3084 uchar auto_flags_arg,
const char *field_name_arg)
3085 :
Field_tiny(ptr_arg, 4, null_ptr_arg, null_bit_arg, auto_flags_arg,
3086 field_name_arg, true, true) {}
3089 0,
NONE, field_name_arg, true, true) {}
3115 static const int PACK_LENGTH = 3;
3117 bool get_date_internal(
MYSQL_TIME *ltime)
const final;
3123 uchar auto_flags_arg,
const char *field_name_arg)
3184 int *warnings)
final;
3200 uchar auto_flags_arg,
const char *field_name_arg,
uint8 dec_arg)
3201 :
Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
3258 bool get_date_internal(
MYSQL_TIME *ltime)
const final;
3262 void store_timestamp_internal(
const my_timeval *tm)
final;
3275 uchar auto_flags_arg,
const char *field_name_arg,
3278 auto_flags_arg, field_name_arg,
3290 field_name_arg, dec_arg) {}
3293 field_name_arg, 0) {}
3323 :
Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
3324 auto_flags_arg, field_name_arg,
cs) {}
3329 field_name_arg,
cs) {}
3355 const char *
string = pointer_cast<const char *>(
ptr);
3367 DBUG_PRINT(
"debug", (
"field_metadata: 0x%04x", field_metadata));
3369 return (((field_metadata >> 4) & 0x300) ^ 0x300) +
3370 (field_metadata & 0x00ff);
3373 uint16 mflags,
int *order_var)
const final;
3431 uint32 max_length = ~0
L)
const final;
3442 uchar *new_null_ptr, uint new_null_bit)
const final;
3449 void hash(ulong *nr, ulong *nr2)
const final;
3540 bool m_uses_backup{
false};
3549 memmove(
ptr + packlength, &from,
sizeof(
char *));
3554 uchar auto_flags_arg,
const char *field_name_arg,
3561 field_name_arg,
cs),
3563 m_keep_old_value(false) {
3565 if (set_packlength) {
3566 packlength = len_arg <= 255 ? 1
3567 : len_arg <= 65535 ? 2
3568 : len_arg <= 16777215 ? 3
3576 packlength(field.packlength),
3579 m_keep_old_value(field.m_keep_old_value),
3610 uint32 max_length = ~0
L)
const override;
3634 void store_length(
uchar *i_ptr, uint i_packlength,
uint32 i_number);
3636 store_length(
ptr, packlength, number);
3639 return get_length(row_offset);
3641 uint32 get_length(ptrdiff_t row_offset = 0)
const;
3649 return get_blob_data(
ptr + packlength + row_offset);
3661 memcpy(&data, position,
sizeof(data));
3668 memcpy(
ptr + packlength, &data,
sizeof(
char *));
3672 store_length(ptr_ofs, packlength,
length);
3673 memcpy(ptr_ofs + packlength, &data,
sizeof(
char *));
3676 set_ptr_offset(0,
length, data);
3689 uint max_length)
const final;
3729 m_keep_old_value = old_value_flag;
3772 if (m_keep_old_value) {
3774 m_keep_old_value =
false;
3782 store_ptr_and_length(from,
length);
3793 bool backup_blob_field();
3799 void restore_blob_backup();
3807 static const uint32 max_dimensions = vector_constants::max_dimensions;
3808 static const uint32 precision =
sizeof(float);
3810 return precision * dimensions;
3820 :
Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
3821 field_name_arg,
share, blob_pack_length,
cs) {
3823 assert(packlength == 4);
3828 :
Field_blob(len_arg, is_nullable_arg, field_name_arg,
cs, false) {
3830 assert(packlength == 4);
3834 assert(packlength == 4);
3841 "vector", get_max_dimensions());
3875 uchar auto_flags_arg,
const char *field_name_arg,
3877 enum geometry_type geom_type_arg, std::optional<gis::srid_t> srid)
3878 :
Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
3881 geom_type(geom_type_arg) {}
3883 enum geometry_type geom_type_arg, std::optional<gis::srid_t> srid)
3887 geom_type(geom_type_arg) {}
3905 if (res !=
TYPE_OK)
return res;
3918 std::optional<gis::srid_t>
get_srid()
const {
return m_srid; }
3928 uchar auto_flags_arg,
const char *field_name_arg,
3930 :
Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
3989 longlong get_diff_vector_and_length(
3996 bool is_before_image_equal_to_after_image()
const;
4007 bool unpack_diff(
const uchar **from);
4050 uint32 max_length = ~0
L)
const final;
4068 const char *get_binary(ptrdiff_t row_offset = 0)
const;
4121 size_t elt_length, uint elt_decimals,
uchar *ptr_arg,
4122 uchar *null_ptr_arg, uint null_bit_arg,
4123 uchar auto_flags_arg,
const char *field_name_arg,
4142 uint
decimals()
const override {
return m_elt_decimals; }
4163 uchar *, uint)
const override;
4215 bool coerce_json_value(
const Json_wrapper *wr,
bool no_error,
4228 const char *get_index_name()
const;
4266 return pack_length_no_ptr();
4271 Field *get_conv_field();
4282 const char *field_name_arg, uint packlength_arg,
4284 :
Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
4285 field_name_arg, charset_arg),
4286 packlength(packlength_arg),
4287 typelib(typelib_arg) {
4291 uint packlength_arg,
TYPELIB *typelib_arg,
4295 field_name_arg, packlength_arg, typelib_arg, charset_arg) {}
4318 return (field_metadata & 0x00ff);
4343 const char *field_name_arg,
uint32 packlength_arg,
4345 :
Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, auto_flags_arg,
4346 field_name_arg, packlength_arg, typelib_arg, charset_arg) {
4355 field_name_arg, packlength_arg, typelib_arg, charset_arg) {}
4399 uchar auto_flags_arg,
const char *field_name_arg);
4416 assert(
ptr == a ||
ptr == b);
4417 const uint cmp_len = bytes_in_rec + (bit_len != 0 ? 1 : 0);
4431 int cmp_offset(ptrdiff_t row_offset)
const final;
4452 return (bytes_in_rec + ((bit_len > 0) ? 1 : 0));
4455 int *order_var)
const final;
4462 uchar *new_null_ptr, uint new_null_bit) const final;
4464 bit_ptr = bit_ptr_arg;
4465 bit_ofs = bit_ofs_arg;
4469 bit_ptr == down_cast<const Field_bit *>(field)->bit_ptr &&
4470 bit_ofs == down_cast<const Field_bit *>(field)->bit_ofs);
4475 if (bit_ptr !=
nullptr) bit_ptr += ptr_diff;
4477 void hash(ulong *nr, ulong *nr2)
const final;
4498 const char *field_name_arg);
4500 const char *field_name_arg)
4503 NONE, field_name_arg) {}
4523 bool treat_bit_as_char, uint pack_length_override,
4524 std::optional<gis::srid_t> srid,
bool is_array);
4618 void invoke_do_copy(
bool reverse =
false);
4619 void invoke_do_copy2(
const Field *from_field,
Field *to_field);
4652 size_t elements_count,
bool treat_bit_as_char,
4659 bool no_conversions);
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
unsigned int my_time_binary_length(unsigned int dec)
Calculate binary size of packed numeric time representation.
Definition: binary_log_funcs.cpp:56
unsigned int my_timestamp_binary_length(unsigned int dec)
Calculate on-disk size of a timestamp value.
Definition: binary_log_funcs.cpp:85
unsigned int my_datetime_binary_length(unsigned int dec)
Calculate binary size of packed datetime representation.
Definition: binary_log_funcs.cpp:70
Definition: sql_bitmap.h:154
Class is used as a BLOB field value storage for intermediate GROUP_CONCAT results.
Definition: table.h:1333
String tmp
Definition: field.h:4601
void(Copy_field *, const Field *, Field *) Copy_func
Convenience definition of a copy function returned by get_copy_func.
Definition: field.h:4597
Field * to_field() const
Definition: field.h:4623
Copy_field(Field *to, Field *from)
Definition: field.h:4605
Field * from_field() const
Definition: field.h:4621
This class represents the cost of evaluating an Item.
Definition: item.h:790
This class is a substitute for the Field classes during CREATE TABLE.
Definition: field.h:1923
my_decimal * val_decimal(my_decimal *) const final
Definition: field.h:1976
type_conversion_status store(longlong, bool) final
Definition: field.h:1948
bool is_wrapper_field() const final
If true, it's a Create_field_wrapper (a sub-class of Field used during CREATE/ALTER that we mustn't c...
Definition: field.h:1997
const Create_field * m_field
Definition: field.h:1924
Create_field_wrapper(const Create_field *fld)
Definition: field.cc:10502
type_conversion_status store_date(Date_val) final
Store a date value into a string column.
Definition: field.h:1960
type_conversion_status store_time(MYSQL_TIME *, uint8) final
Store MYSQL_TIME value with the given amount of decimal digits into a field.
Definition: field.h:1964
size_t make_sort_key(uchar *, size_t) const final
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:1990
int cmp(const uchar *, const uchar *) const final
Definition: field.h:1984
void sql_type(String &) const final
Definition: field.h:1988
Item_result numeric_context_result_type() const final
Returns Item_result type of a field when it appears in numeric context such as: SELECT time_column + ...
Definition: field.cc:10515
Item_result result_type() const final
Definition: field.cc:10511
longlong val_int(void) const final
Definition: field.h:1972
String * val_str(String *, String *) const final
Definition: field.h:1980
type_conversion_status store(const char *, size_t, const CHARSET_INFO *) final
Definition: field.h:1939
type_conversion_status store(double) final
Definition: field.h:1944
uint32 pack_length() const final
Definition: field.cc:10528
double val_real(void) const final
Definition: field.h:1968
type_conversion_status store_time(Time_val, uint8) final
Store a time value into a string column.
Definition: field.h:1956
const CHARSET_INFO * charset() const final
Definition: field.cc:10524
Field * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:1994
uint32 max_display_length() const final
Definition: field.cc:10532
type_conversion_status store_decimal(const my_decimal *) final
Definition: field.h:1952
enum_field_types type() const final
Definition: field.cc:10520
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
Date_val is a temporal type that represents dates within the range 0000-01-01 and 9999-12-31.
Definition: my_temporal.h:421
Definition: my_temporal.h:341
Definition: sql_error.h:228
BIT field represented as chars for non-MyISAM tables.
Definition: field.h:4494
enum ha_base_keytype key_type() const final
Definition: field.h:4504
Field_bit_as_char(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg)
Definition: field.h:4499
Field_bit_as_char * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:4510
uchar * bit_ptr
Definition: field.h:4393
uchar bit_ofs
Definition: field.h:4394
bool eq(const Field *field) const final
Definition: field.h:4467
void get_image(uchar *buff, size_t length, const CHARSET_INFO *) const final
Definition: field.h:4432
uint row_pack_length() const final
Definition: field.h:4451
int cmp(const uchar *a, const uchar *b) const final
Definition: field.h:4415
enum_field_types type() const final
Definition: field.h:4400
uint bit_len
Definition: field.h:4395
void set_image(const uchar *buff, size_t length, const CHARSET_INFO *cs) final
Definition: field.h:4435
int cmp_binary_offset(ptrdiff_t row_offset) const final
Definition: field.h:4423
uint32 pack_length() const final
Definition: field.h:4448
Field_bit * clone(MEM_ROOT *mem_root) const override
Makes a shallow copy of the Field object.
Definition: field.h:4478
uint bytes_in_rec
Definition: field.h:4396
uint32 pack_length_in_rec() const final
Definition: field.h:4449
uint32 max_display_length() const final
Definition: field.h:4402
void set_key_image(const uchar *buff, size_t length) final
Definition: field.h:4440
enum ha_base_keytype key_type() const override
Definition: field.h:4401
type_conversion_status store(const char *to, size_t length, const CHARSET_INFO *charset) override
Definition: field.cc:8799
size_t make_sort_key(uchar *buff, size_t length) const final
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:4444
Item_result result_type() const final
Definition: field.h:4403
void move_field_offset(ptrdiff_t ptr_diff) final
Definition: field.h:4473
int key_cmp(const uchar *a, const uchar *b) const final
Definition: field.h:4427
type_conversion_status store(const char *to, size_t length, const CHARSET_INFO *charset) override
Definition: field.cc:7040
bool match_collation_to_optimize_range() const override
Definition: field.h:3590
const uchar * data_ptr() const final
Get a const pointer to the BLOB data of this field.
Definition: field.h:3652
String old_value
In order to support update of virtual generated columns of blob type, we need to allocate the space b...
Definition: field.h:3489
const uchar * get_blob_data() const
Get a const pointer to the BLOB data of this field.
Definition: field.h:3645
size_t get_field_buffer_size()
Definition: field.h:3633
bool m_uses_backup
Whether the field uses table's backup value storage.
Definition: field.h:3540
Field_blob(const Field_blob &field)
Copy static information and reset dynamic information.
Definition: field.h:3574
Field_blob * clone(MEM_ROOT *mem_root) const override
Makes a shallow copy of the Field object.
Definition: field.h:3683
uint32 pack_length_no_ptr() const
Return the packed length without the pointer size added.
Definition: field.h:3628
uint row_pack_length() const final
Definition: field.h:3629
uint packlength
The number of bytes used to represent the length of the blob.
Definition: field.h:3475
void set_keep_old_value(bool old_value_flag)
Mark that the BLOB stored in value should be copied before updating it.
Definition: field.h:3718
uint32 max_data_length() const override
Get the maximum size of the data in packed format.
Definition: field.h:3630
uint32 pack_length() const final
Definition: field.h:3616
void store_length(uint32 number)
Definition: field.h:3635
enum_field_types type() const override
Definition: field.h:3589
uchar * get_blob_data(ptrdiff_t row_offset=0)
Get a non-const pointer to the BLOB data of this field.
Definition: field.h:3647
Field_blob(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, const CHARSET_INFO *cs, bool set_packlength)
Definition: field.h:3557
static uchar * get_blob_data(const uchar *position)
Get the BLOB data pointer stored at the specified position in the record buffer.
Definition: field.h:3659
uint32 key_length() const override
Definition: field.h:3613
String value
The 'value'-object is a cache fronting the storage engine.
Definition: field.h:3480
void keep_old_value()
Save the current BLOB value to avoid that it gets overwritten.
Definition: field.h:3764
void set_ptr(const uchar *length, const uchar *data)
Definition: field.h:3666
int cmp(const uchar *a, const uchar *b) const final
Definition: field.h:3604
size_t make_sort_key(uchar *buff, size_t length) const override
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.cc:7325
void store_in_allocated_space(const char *from, uint32 length)
Use to store the blob value into an allocated space.
Definition: field.h:3781
enum ha_base_keytype key_type() const override
Definition: field.h:3591
void set_ptr_offset(ptrdiff_t ptr_diff, uint32 length, const uchar *data)
Definition: field.h:3670
bool has_charset() const override
Definition: field.h:3698
void store_ptr_and_length(const char *from, uint32 length)
Store ptr and length.
Definition: field.h:3547
void set_ptr(uint32 length, const uchar *data)
Definition: field.h:3675
String m_blob_backup
Backup String for table's blob fields.
Definition: field.h:3533
uint32 data_length(ptrdiff_t row_offset=0) const final
Definition: field.h:3638
bool m_keep_old_value
Whether we need to move the content of 'value' to 'old_value' before updating the BLOB stored in 'val...
Definition: field.h:3510
Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg)
Definition: field.h:3122
enum_field_types real_type() const final
Definition: field.h:3132
bool zero_pack() const final
Definition: field.h:3144
enum ha_base_keytype key_type() const final
Definition: field.h:3133
Field_date * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3147
Field_date(bool is_nullable_arg, const char *field_name_arg)
Definition: field.h:3127
enum_field_types type() const final
Definition: field.h:3131
uint pack_length_from_metadata(uint field_metadata) const final
Definition: field.h:3303
enum_field_types type() const final
Definition: field.h:3299
Field_datetime(bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg)
Constructor for Field_datetime.
Definition: field.h:3286
Field_datetime * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3294
Field_datetime(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg)
Constructor for Field_datetime.
Definition: field.h:3274
Field_datetime(const char *field_name_arg)
Definition: field.h:3291
bool zero_pack() const final
Definition: field.h:3308
enum_field_types binlog_type() const final
Definition: field.h:3301
enum_field_types real_type() const final
Definition: field.h:3300
uint32 pack_length() const final
Definition: field.h:3302
enum ha_base_keytype key_type() const final
Definition: field.h:2164
const uchar * unpack(uchar *to, const uchar *from, uint param_data) final
Unpack a field from row data.
Definition: field.h:2184
enum_field_types type() const final
Definition: field.h:2163
uchar * pack(uchar *to, const uchar *from, size_t max_length) const final
Pack the field into a format suitable for storage and transfer.
Definition: field.h:2187
Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2157
Field_decimal * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2180
Field_double(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg, bool unsigned_arg)
Definition: field.h:2570
Field_double * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2597
enum ha_base_keytype key_type() const final
Definition: field.h:2583
Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2559
Field_double(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg)
Definition: field.h:2565
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2602
Field_double(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg, bool unsigned_arg, bool not_fixed_arg)
Definition: field.h:2575
enum_field_types type() const final
Definition: field.h:2582
bool has_charset() const override
Definition: field.h:4324
bool optimize_range(uint, uint) const final
Whether this field can be used for index range scans when in the given keypart of the given index.
Definition: field.h:4322
uint pack_length_from_metadata(uint field_metadata) const final
Definition: field.h:4317
Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint packlength_arg, TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
Definition: field.h:4280
enum_field_types real_type() const override
Definition: field.h:4316
bool match_collation_to_optimize_range() const final
Definition: field.h:4298
Field_enum * clone(MEM_ROOT *mem_root) const override
Makes a shallow copy of the Field object.
Definition: field.h:4327
TYPELIB * typelib
Definition: field.h:4279
Field_enum(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint packlength_arg, TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
Definition: field.h:4290
uint packlength
Definition: field.h:4276
enum Item_result cast_to_int_type() const final
Definition: field.h:4300
const CHARSET_INFO * sort_charset() const final
Definition: field.h:4326
enum Item_result cmp_type() const final
Definition: field.h:4299
bool zero_pack() const override
Definition: field.h:4321
uint row_pack_length() const final
Definition: field.h:4320
enum_field_types type() const final
Definition: field.h:4297
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2546
Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2515
Field_float(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg, bool unsigned_arg)
Definition: field.h:2521
Field_float * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2541
enum ha_base_keytype key_type() const final
Definition: field.h:2527
enum_field_types type() const final
Definition: field.h:2526
std::optional< gis::srid_t > get_srid() const
Definition: field.h:3918
enum geometry_type geom_type
Definition: field.h:3872
type_conversion_status reset() final
Non-nullable GEOMETRY types cannot have defaults, but the underlying blob must still be reset.
Definition: field.h:3903
geometry_type get_geometry_type() const final
Definition: field.h:3911
Field_geom * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3912
Field_geom(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, enum geometry_type geom_type_arg, std::optional< gis::srid_t > srid)
Definition: field.h:3882
bool match_collation_to_optimize_range() const final
Definition: field.h:3890
const std::optional< gis::srid_t > m_srid
Definition: field.h:3866
Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, TABLE_SHARE *share, uint blob_pack_length, enum geometry_type geom_type_arg, std::optional< gis::srid_t > srid)
Definition: field.h:3874
enum_field_types type() const final
Definition: field.h:3889
enum ha_base_keytype key_type() const final
Definition: field.h:3888
A field that stores a JSON value.
Definition: field.h:3922
size_t make_sort_key(uchar *to, size_t length) const override
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.cc:8136
Field_json(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg)
Definition: field.h:3933
bool has_charset() const final
JSON columns don't have an associated charset.
Definition: field.h:3957
Field_json(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, TABLE_SHARE *share, uint blob_pack_length)
Definition: field.h:3927
const CHARSET_INFO * charset() const override
Return a text charset so that string functions automatically convert the field value to string and tr...
Definition: field.h:3944
const CHARSET_INFO * sort_charset() const final
Sort should treat the field as binary and not attempt any conversions.
Definition: field.h:3951
enum_field_types type() const override
Definition: field.h:3937
Field_long * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2445
enum_field_types type() const final
Definition: field.h:2425
uchar * pack(uchar *to, const uchar *from, size_t max_length) const final
Pack the field into a format suitable for storage and transfer.
Definition: field.h:2449
uint32 max_display_length() const final
Definition: field.h:2442
enum ha_base_keytype key_type() const final
Definition: field.h:2426
enum Item_result result_type() const final
Definition: field.h:2424
Field_long(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2419
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2457
const uchar * unpack(uchar *to, const uchar *from, uint param_data) final
Unpack a field from row data.
Definition: field.h:2452
Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2414
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2508
Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2466
enum_field_types type() const final
Definition: field.h:2477
uchar * pack(uchar *to, const uchar *from, size_t max_length) const final
Pack the field into a format suitable for storage and transfer.
Definition: field.h:2500
uint32 max_display_length() const final
Definition: field.h:2495
enum Item_result result_type() const final
Definition: field.h:2476
Field_longlong * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2496
bool can_be_compared_as_longlong() const final
Definition: field.h:2494
const uchar * unpack(uchar *to, const uchar *from, uint param_data) final
Unpack a field from row data.
Definition: field.h:2503
Field_longlong(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2471
enum ha_base_keytype key_type() const final
Definition: field.h:2478
bool is_updatable() const final
Checks whether a string field is part of write_set.
Definition: field.cc:10443
type_conversion_status report_if_important_data(const char *ptr, const char *end, bool count_spaces)
Definition: field.cc:6065
type_conversion_status check_string_copy_error(const char *well_formed_error_pos, const char *cannot_convert_error_pos, const char *from_end_pos, const char *end, bool count_spaces, const CHARSET_INFO *from_cs, const CHARSET_INFO *to_cs)
Report "not well formed" or "cannot convert" error after storing a character string info a field.
Definition: field.cc:6016
uint32 max_data_length() const override
Get the maximum size of the data in packed format.
Definition: field.cc:6199
Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, const CHARSET_INFO *charset_arg)
Definition: field.h:2112
type_conversion_status store_decimal(const my_decimal *d) override
Decimal representation of Field_str.
Definition: field.cc:6193
uint32 max_display_length() const final
Definition: field.h:2400
enum Item_result result_type() const final
Definition: field.h:2382
Field_medium * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2401
Field_medium(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2377
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2405
enum_field_types type() const final
Definition: field.h:2383
enum ha_base_keytype key_type() const final
Definition: field.h:2384
Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2372
uint precision
Definition: field.h:2211
enum_field_types type() const final
Definition: field.h:2226
Field_new_decimal * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2258
uint32 max_display_length() const final
Definition: field.h:2252
uint bin_size
Definition: field.h:2212
Item_result result_type() const final
Definition: field.h:2228
uint32 pack_length() const final
Definition: field.h:2253
void set_keep_precision(bool arg)
Definition: field.h:2265
enum ha_base_keytype key_type() const final
Definition: field.h:2227
int cmp(const uchar *, const uchar *) const final
Definition: field.h:2640
double val_real() const final
Definition: field.h:2633
enum_field_types type() const final
Definition: field.h:2622
type_conversion_status store(const char *, size_t, const CHARSET_INFO *) final
Definition: field.h:2623
type_conversion_status reset() final
Definition: field.h:2632
String * val_str(String *, String *value2) const final
Definition: field.h:2636
my_decimal * val_decimal(my_decimal *) const final
Definition: field.h:2635
type_conversion_status store(double) final
Store double value in Field_string or Field_varstring.
Definition: field.h:2627
longlong val_int() const final
Definition: field.h:2634
type_conversion_status store(longlong, bool) final
Definition: field.h:2628
size_t make_sort_key(uchar *, size_t len) const final
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:2642
Field_null(uchar *ptr_arg, uint32 len_arg, uchar auto_flags_arg, const char *field_name_arg, const CHARSET_INFO *cs)
Definition: field.h:2617
type_conversion_status store_decimal(const my_decimal *) final
Decimal representation of Field_str.
Definition: field.h:2629
uint32 max_display_length() const final
Definition: field.h:2645
uint32 pack_length() const final
Definition: field.h:2643
Field_null * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2646
uint repertoire() const final
Definition: field.h:2024
uint row_pack_length() const final
Definition: field.h:2038
uint decimals() const final
Definition: field.h:2027
bool zerofill
True if the column was declared with the ZEROFILL attribute.
Definition: field.h:2016
bool eq_def(const Field *field) const final
Definition: field.cc:8679
my_decimal * val_decimal(my_decimal *) const override
Return decimal value of integer field.
Definition: field.cc:2232
bool val_datetime(Datetime_val *dt, my_time_flags_t flags) const override
Retrieve field value and return the result as a datetime/timestamp.
Definition: field.cc:2245
bool is_unsigned() const final
Whether the field is signed or not.
Definition: field.h:2021
const CHARSET_INFO * charset() const final
Definition: field.h:2025
Field_num(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg)
Numeric fields base class constructor.
Definition: field.cc:1664
type_conversion_status check_int(const CHARSET_INFO *cs, const char *str, size_t length, const char *int_end, int error)
Test if given number is a int.
Definition: field.cc:1708
type_conversion_status store_time(Time_val time, uint8 dec_arg) override
Store a time value into a string column.
Definition: field.cc:1784
Item_result result_type() const override
Definition: field.h:2022
uint32 pack_length_from_metadata(uint) const override
Definition: field.h:2039
bool val_date(Date_val *date, my_time_flags_t flags) const override
Retrieve field value and return the result as a date.
Definition: field.cc:2240
type_conversion_status get_int(const CHARSET_INFO *cs, const char *from, size_t len, longlong *rnd, ulonglong unsigned_max, longlong signed_min, longlong signed_max)
Definition: field.cc:1751
enum Derivation derivation() const final
Definition: field.h:2023
type_conversion_status store_date(Date_val date) override
Store a date value into a string column.
Definition: field.cc:1788
const uint8 dec
Definition: field.h:2010
bool val_time(Time_val *time) const override
Retrieve field value and return the result as a time.
Definition: field.cc:2250
const bool unsigned_flag
Whether the field is signed or not.
Definition: field.h:2007
uint is_equal(const Create_field *new_field) const override
Check whether two numeric fields can be considered 'equal' for table alteration purposes.
Definition: field.cc:8695
type_conversion_status store_decimal(const my_decimal *) override
Storing decimal in integer fields.
Definition: field.cc:2209
void prepend_zeros(String *value) const
Definition: field.cc:1677
bool not_fixed
Definition: field.h:2126
uint32 max_display_length() const final
Definition: field.h:2150
Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2133
Truncate_result
Definition: field.h:2127
bool has_charset() const final
Definition: field.h:4370
Field_set * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:4371
enum_field_types real_type() const final
Definition: field.h:4369
type_conversion_status store(double nr) final
Store double value in Field_string or Field_varstring.
Definition: field.h:4358
Field_set(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, uint32 packlength_arg, TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
Definition: field.h:4350
Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint32 packlength_arg, TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
Definition: field.h:4341
bool zero_pack() const final
Definition: field.h:4366
type_conversion_status store(const char *to, size_t length, const CHARSET_INFO *charset) final
Definition: field.cc:8416
uint32 max_display_length() const final
Definition: field.h:2351
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2365
const uchar * unpack(uchar *to, const uchar *from, uint param_data) final
Unpack a field from row data.
Definition: field.h:2360
Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2321
Field_short(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2326
enum_field_types type() const final
Definition: field.h:2334
uchar * pack(uchar *to, const uchar *from, size_t max_length) const final
Pack the field into a format suitable for storage and transfer.
Definition: field.h:2356
Field_short * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:2352
enum ha_base_keytype key_type() const final
Definition: field.h:2335
enum Item_result result_type() const final
Definition: field.h:2333
Field_short(uint32 len_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2331
enum Derivation field_derivation
Definition: field.h:2054
void set_field_length(uint32 length) final
Definition: field.h:2076
Item_result numeric_context_result_type() const final
Returns Item_result type of a field when it appears in numeric context such as: SELECT time_column + ...
Definition: field.h:2061
type_conversion_status store(double nr) override
Store double value in Field_string or Field_varstring.
Definition: field.cc:6126
type_conversion_status store(longlong nr, bool unsigned_val) override=0
uint is_equal(const Create_field *new_field) const override
Whether a field being created is type-compatible with an existing one.
Definition: field.cc:6161
type_conversion_status store(const char *to, size_t length, const CHARSET_INFO *cs) override=0
uint repertoire() const final
Definition: field.h:2070
type_conversion_status store_decimal(const my_decimal *) override
Decimal representation of Field_str.
Definition: field.cc:2292
uint decimals() const override
Definition: field.h:2062
void add_to_cost(CostOfItem *cost) const override
Update '*cost' with the fact that this Field is accessed.
Definition: field.cc:6182
uint32 max_display_length() const override
Definition: field.h:2085
bool binary() const override
Definition: field.h:2084
void set_charset(const CHARSET_INFO *charset_arg)
Definition: field.h:2072
Field_str(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, const CHARSET_INFO *charset)
Definition: field.cc:2255
Item_result result_type() const override
Definition: field.h:2060
void make_send_field(Send_field *field) const override
Populates a Send_field object with metadata about the column represented by this Field object.
Definition: field.cc:2267
const CHARSET_INFO * charset() const override
Definition: field.h:2071
uint32 char_length_cache
Definition: field.h:2094
bool str_needs_quotes() const final
Definition: field.h:2086
void set_derivation(enum Derivation derivation_arg) final
Definition: field.h:2081
const CHARSET_INFO * field_charset
Definition: field.h:2053
enum Derivation derivation() const final
Definition: field.h:2080
bool is_text_key_type() const final
Definition: field.h:3385
bool match_collation_to_optimize_range() const final
Definition: field.h:3332
uint row_pack_length() const final
Definition: field.h:3374
bool has_charset() const final
Definition: field.h:3377
type_conversion_status reset() final
Definition: field.h:3337
Field_string(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, const CHARSET_INFO *cs)
Definition: field.h:3320
uint pack_length_from_metadata(uint field_metadata) const final
Definition: field.h:3366
enum ha_base_keytype key_type() const final
Definition: field.h:3333
bool zero_pack() const final
Definition: field.h:3336
Field_string * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3380
Field_string(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, const CHARSET_INFO *cs)
Definition: field.h:3325
enum_field_types type() const final
Definition: field.h:3331
Abstract class for types with date and time: DATETIME, DATETIME(N), TIMESTAMP, TIMESTAMP(N).
Definition: field.h:2949
Field_temporal_with_date_and_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg)
Constructor for Field_temporal_with_date_and_time.
Definition: field.h:2966
uint decimals() const final
Definition: field.h:2973
uint row_pack_length() const final
Definition: field.h:2983
const CHARSET_INFO * sort_charset() const final
Definition: field.h:2974
int cmp(const uchar *a_ptr, const uchar *b_ptr) const final
Definition: field.h:2980
size_t make_sort_key(uchar *to, size_t length) const final
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:2976
int do_save_field_metadata(uchar *metadata_ptr) const final
Retrieve the field metadata for fields.
Definition: field.h:2951
Abstract class for types with date with optional time, with or without fractional part: DATE,...
Definition: field.h:2887
virtual bool get_date_internal(MYSQL_TIME *ltime) const =0
Low level function to get value into MYSQL_TIME, without checking for being valid.
virtual bool get_date_internal_at_utc(MYSQL_TIME *ltime) const
Definition: field.h:2895
Field_temporal_with_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 int_length_arg, uint8 dec_arg)
Constructor for Field_temporal.
Definition: field.h:2929
Item_result numeric_context_result_type() const final
Returns Item_result type of a field when it appears in numeric context such as: SELECT time_column + ...
Definition: field.h:2839
enum Item_result cmp_type() const final
Definition: field.h:2842
uint repertoire() const final
Definition: field.h:2844
bool str_needs_quotes() const final
Definition: field.h:2837
virtual type_conversion_status store_internal(const MYSQL_TIME *ltime, int *error)=0
Low level routine to store a MYSQL_TIME value into a field.
bool can_be_compared_as_longlong() const final
Definition: field.h:2846
const CHARSET_INFO * charset() const final
Definition: field.h:2845
static my_time_flags_t temporal_flags(sql_mode_t mode)
Flags for evaluation of temporal values, based on current SQL mode.
Definition: field.h:2874
uint32 max_display_length() const final
Definition: field.h:2836
my_time_flags_t get_date_flags(const THD *thd) const
Definition: field.h:2861
bool binary() const final
Definition: field.h:2847
my_time_flags_t date_flags() const
Flags that are passed as "flag" argument to check_date(), int_to_datetime(), str_to_datetime().
Definition: field.cc:4781
static uint8 normalize_dec(uint8 dec_arg)
Adjust number of decimal digits from DECIMAL_NOT_SPECIFIED to DATETIME_MAX_DECIMALS.
Definition: field.h:2663
uint8 get_dec() const
Definition: field.h:2857
virtual my_time_flags_t date_flags(const THD *thd) const
Flags that are passed as "flag" argument to store functions, and to e.g.
Definition: field.h:2781
virtual bool convert_str_to_TIME(const char *str, size_t len, const CHARSET_INFO *cs, MYSQL_TIME *ltime, MYSQL_TIME_STATUS *status)=0
Convert a string to MYSQL_TIME, according to the field type.
virtual type_conversion_status store_internal_adjust_frac(MYSQL_TIME *ltime, int *warnings)=0
Low level routine to store a MYSQL_TIME value into a field with rounding/truncation according to the ...
Item_result result_type() const final
Definition: field.h:2835
enum Derivation derivation() const final
Definition: field.h:2843
Field_temporal(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint32 len_arg, uint8 dec_arg)
Constructor for Field_temporal.
Definition: field.h:2825
uint8 get_fractional_digits() const
Definition: field.h:2865
double val_real() const override
Definition: field.h:2853
uint8 dec
Definition: field.h:2657
virtual type_conversion_status convert_number_to_TIME(longlong val, bool unsigned_val, int nanoseconds, MYSQL_TIME *ltime, int *warning)=0
Convert a number with fractional part with nanosecond precision into MYSQL_TIME, according to the fie...
Field implementing TIME(N) data type, where N=0..6.
Definition: field.h:3157
Field_time(bool is_nullable_arg, const char *field_name_arg, uint8 dec_arg)
Constructor for Field_time.
Definition: field.h:3209
bool zero_pack() const final
Definition: field.h:3241
int cmp(const uchar *a_ptr, const uchar *b_ptr) const final
Definition: field.h:3248
int do_save_field_metadata(uchar *metadata_ptr) const final
Retrieve the field metadata for fields.
Definition: field.h:3159
enum_field_types binlog_type() const final
Definition: field.h:3219
uint row_pack_length() const final
Definition: field.h:3239
Field_time * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3212
uint pack_length_from_metadata(uint field_metadata) const final
Definition: field.h:3234
enum_field_types type() const final
Definition: field.h:3217
size_t make_sort_key(uchar *to, size_t length) const final
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:3244
enum_field_types real_type() const final
Definition: field.h:3218
uint decimals() const final
Definition: field.h:3216
const CHARSET_INFO * sort_charset() const final
Definition: field.h:3242
Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, uint8 dec_arg)
Constructor for Field_time.
Definition: field.h:3199
uint pack_length_from_metadata(uint field_metadata) const final
Definition: field.h:3052
bool zero_pack() const final
Definition: field.h:3049
Field_timestamp * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3041
enum_field_types real_type() const final
Definition: field.h:3047
enum_field_types binlog_type() const final
Definition: field.h:3048
uint32 pack_length() const final
Definition: field.h:3051
enum_field_types type() const final
Definition: field.h:3046
ulonglong get_max_int_value() const final
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:2314
Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, bool zero_arg, bool unsigned_arg)
Definition: field.h:2270
uint32 max_display_length() const final
Definition: field.h:2298
enum_field_types type() const override
Definition: field.h:2281
uchar * pack(uchar *to, const uchar *from, size_t max_length) const final
Pack the field into a format suitable for storage and transfer.
Definition: field.h:2303
enum Item_result result_type() const final
Definition: field.h:2280
Field_tiny * clone(MEM_ROOT *mem_root) const override
Makes a shallow copy of the Field object.
Definition: field.h:2299
const uchar * unpack(uchar *to, const uchar *from, uint param_data) final
Unpack a field from row data.
Definition: field.h:2308
enum ha_base_keytype key_type() const final
Definition: field.h:2282
uint32 pack_length() const final
Definition: field.h:2296
Field_tiny(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, bool unsigned_arg)
Definition: field.h:2275
Field that stores array of values of the same type.
Definition: field.h:4100
bool binary() const override
Definition: field.h:4143
enum_field_types m_elt_type
The array element's real type.
Definition: field.h:4104
bool is_array() const override
Whether the field is a typed array.
Definition: field.h:4140
uint decimals() const override
Definition: field.h:4142
const CHARSET_INFO * charset() const override
Return a text charset so that string functions automatically convert the field value to string and tr...
Definition: field.h:4147
enum_field_types real_type() const override
Definition: field.h:4133
uint pack_length_from_metadata(uint) const override
Definition: field.h:4265
bool match_collation_to_optimize_range() const override
Multi-valued index always works only as a pre-filter for actual condition check, and the latter alway...
Definition: field.h:4195
enum_field_types binlog_type() const override
Definition: field.h:4134
int key_cmp(const uchar *, const uchar *) const override
These methods are used by handler to prevent returning a row past the end_range during range access.
Definition: field.h:4170
uint m_elt_decimals
Element's decimals.
Definition: field.h:4106
const bool unsigned_flag
Definition: field.h:4109
enum_field_types type() const override
Definition: field.h:4130
uint32 get_length_bytes() const override
Return number of bytes the field's length takes.
Definition: field.h:4229
uint32 char_length() const override
maximum possible character length for blob.
Definition: field.h:4126
const CHARSET_INFO * m_elt_charset
Element's charset.
Definition: field.h:4108
bool is_unsigned() const final
Whether the field is signed or not.
Definition: field.h:4139
size_t make_sort_key(uchar *to, size_t max_len) const override
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:4234
bool match_collation_to_optimize_range() const final
Definition: field.h:3402
uint32 pack_length() const final
Definition: field.h:3406
bool is_text_key_type() const final
Definition: field.h:3451
const uchar * data_ptr() const final
Return a const pointer to the actual data in the record buffer.
Definition: field.h:3450
bool zero_pack() const final
Definition: field.h:3405
Field_varstring * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3443
bool has_charset() const final
Definition: field.h:3437
uint32 key_length() const final
Definition: field.h:3409
uint32 length_bytes
Definition: field.h:3456
enum_field_types type() const final
Definition: field.h:3401
uint32 get_length_bytes() const override
Return number of bytes the field's length takes.
Definition: field.h:3452
uint32 char_length() const override
maximum possible character length for blob.
Definition: field.h:3849
enum_field_types real_type() const final
Definition: field.h:3851
enum_field_types type() const final
Definition: field.h:3850
Field_vector(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg, TABLE_SHARE *share, uint blob_pack_length, const CHARSET_INFO *cs)
Definition: field.h:3816
Field_vector(uint32 len_arg, bool is_nullable_arg, const char *field_name_arg, const CHARSET_INFO *cs)
Definition: field.h:3826
uint32 get_max_dimensions() const
Definition: field.h:3812
Field_vector * clone(MEM_ROOT *mem_root) const override
Makes a shallow copy of the Field object.
Definition: field.h:3844
uint32 max_data_length() const override
Get the maximum size of the data in packed format.
Definition: field.h:3848
void sql_type(String &res) const override
Definition: field.h:3837
Field_vector(const Field_vector &field)
Definition: field.h:3833
static uint32 dimension_bytes(uint32 dimensions)
Definition: field.h:3809
Limits
Definition: field.h:3082
Field_year(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, const char *field_name_arg)
Definition: field.h:3083
Field_year * clone(MEM_ROOT *mem_root) const final
Makes a shallow copy of the Field object.
Definition: field.h:3107
enum_field_types type() const final
Definition: field.h:3090
Field_year(bool is_nullable_arg, const char *field_name_arg)
Definition: field.h:3087
Field(const Field &)=default
Key_map get_covering_prefix_keys() const
Get covering prefix keys.
Definition: field.cc:10266
uchar * pack(uchar *to) const
Definition: field.h:1531
uchar * pack_int16(uchar *to, const uchar *from, size_t max_length) const
Definition: field.cc:10399
virtual void set_default()
Definition: field.cc:10280
void reset_warnings()
Definition: field.h:906
virtual int cmp_binary(const uchar *a, const uchar *b, uint32 max_length=~0L) const
Definition: field.h:1198
virtual enum_field_types real_type() const
Definition: field.h:1171
virtual type_conversion_status store(double nr)=0
virtual bool pack_diff(uchar **to, ulonglong value_options) const
Write the field for the binary log in diff format.
Definition: field.h:1580
virtual uint max_packed_col_length() const
This is a wrapper around pack_length() used by filesort() to determine how many bytes we need for pac...
Definition: field.h:1591
Key_map part_of_sortkey
Definition: field.h:697
const char * orig_table_name
Pointer to original table name, only non-NULL for a temporary table.
Definition: field.h:689
virtual const uchar * data_ptr() const
Return a const pointer to the actual data in the record buffer.
Definition: field.h:1785
bool is_virtual_gcol() const
Definition: field.h:833
const uchar * unpack_int24(uchar *to, const uchar *from) const
Definition: field.cc:10416
virtual uint32 pack_length_in_rec() const
Definition: field.h:1073
const char ** table_name
Definition: field.h:690
uint null_offset() const
Definition: field.cc:10288
const uchar * unpack_int16(uchar *to, const uchar *from) const
Definition: field.cc:10405
virtual bool compatible_field_size(uint metadata, Relay_log_info *, uint16, int *order) const
Check to see if field size is compatible with destination.
Definition: field.cc:2022
LEX_CSTRING masking_policy() const
Returns the name of the masking policy, or an empty string if no masking policy is defined on this co...
Definition: field.h:855
imagetype
Definition: field.h:732
@ itRAW
Definition: field.h:732
@ itMBR
Definition: field.h:732
const CHARSET_INFO * charset_for_protocol() const
Definition: field.h:1633
void reset_tmp_nullable()
Turn off temporary nullability for the field.
Definition: field.h:916
virtual int do_save_field_metadata(uchar *metadata_ptr) const
Retrieve the field metadata for fields.
Definition: field.h:1890
virtual ulonglong get_max_int_value() const
Get the upper limit of the MySQL integral and floating-point type.
Definition: field.h:1773
void set_tmp_null()
Set field to temporary value NULL.
Definition: field.cc:1378
virtual bool send_to_protocol(Protocol *protocol) const
Send the value of this field over the protocol using the correct Protocol::store*() function which ma...
Definition: field.cc:1983
virtual uint decimals() const
Definition: field.h:1214
virtual Field * new_key_field(MEM_ROOT *root, TABLE *new_table, uchar *new_ptr, uchar *new_null_ptr, uint new_null_bit) const
Definition: field.cc:2386
uint32 field_length
Definition: field.h:745
static constexpr size_t MAX_SHORT_BLOB_WIDTH
Definition: field.h:739
virtual Item_result cast_to_int_type() const
Definition: field.h:1050
void set_null_ptr(uchar *p_null_ptr, uint p_null_bit)
Definition: field.h:1313
void copy_data(ptrdiff_t src_record_offset)
Definition: field.cc:1971
bool m_is_tmp_null
This is a flag with the following semantics:
Definition: field.h:661
static constexpr size_t MAX_LONG_BLOB_WIDTH
Definition: field.h:741
type_conversion_status store_time(MYSQL_TIME *ltime)
Store MYSQL_TYPE value into a field when the number of fractional digits is not important or is not k...
Definition: field.h:992
void operator=(Field &)=delete
virtual type_conversion_status validate_stored_val(THD *thd)
Validate the value stored in a field.
Definition: field.h:1760
static uchar dummy_null_buffer
Definition: field.h:680
virtual bool is_array() const
Whether the field is a typed array.
Definition: field.h:1840
virtual bool optimize_range(uint idx, uint part) const
Whether this field can be used for index range scans when in the given keypart of the given index.
Definition: field.cc:2354
bool has_insert_default_general_value_expression() const
Checks if the field is marked as having a general expression to generate default values.
Definition: field.h:593
Key_map key_start
Definition: field.h:693
void set_null(ptrdiff_t row_offset=0)
Set field to value NULL.
Definition: field.cc:1931
virtual type_conversion_status store_decimal(const my_decimal *d)=0
virtual bool binary() const
Definition: field.h:1166
longlong val_int(uchar *new_ptr)
Definition: field.h:1472
Value_generator * gcol_info
Definition: field.h:820
ha_storage_media field_storage_type() const
Definition: field.h:1737
int cmp(const uchar *str) const
Definition: field.h:1192
virtual bool str_needs_quotes() const
Definition: field.h:1034
static constexpr size_t MAX_VARCHAR_WIDTH
Definition: field.h:735
virtual void get_image(uchar *buff, size_t length, const CHARSET_INFO *) const
Definition: field.h:1422
static constexpr size_t MAX_TINY_BLOB_WIDTH
Definition: field.h:738
const char * field_name
Definition: field.h:690
void set_field_ptr(uchar *ptr_arg)
Definition: field.h:1803
void clear_flag(unsigned flag)
Definition: field.h:758
uchar * pack_int24(uchar *to, const uchar *from, size_t max_length) const
Definition: field.cc:10410
Value_generator * m_default_val_expr
Holds the expression to be used to generate default values.
Definition: field.h:836
const uchar * field_ptr() const
Return a const pointer to where the field is stored in the record buffer.
Definition: field.h:1793
virtual void add_to_cost(CostOfItem *cost) const
Update '*cost' with the fact that this Field is accessed.
Definition: field.cc:1403
virtual longlong val_date_temporal() const
Returns DATE/DATETIME value in packed longlong format.
Definition: field.h:1005
virtual uint32 pack_length() const
Definition: field.h:1066
void set_hidden(dd::Column::enum_hidden_type hidden)
Sets the hidden type for this field.
Definition: field.h:843
LEX_CSTRING comment
Definition: field.h:691
uint16 m_field_index
Definition: field.h:753
virtual const CHARSET_INFO * charset() const
Definition: field.h:1631
void set_notnull(ptrdiff_t row_offset=0)
Set field to value NOT NULL.
Definition: field.cc:1946
virtual uint32 get_length_bytes() const
Return number of bytes the field's length takes.
Definition: field.h:1847
virtual size_t make_sort_key(uchar *buff, size_t length, size_t trunc_pos) const
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
Definition: field.h:1363
bool gcol_expr_is_equal(const Create_field *field) const
Check whether generated columns' expressions are the same.
Definition: field.cc:6156
virtual uint32 max_display_length() const =0
enum_auto_flags
Flags for Field::auto_flags / Create_field::auto_flags bitmaps.
Definition: field.h:714
@ ON_UPDATE_NOW
ON UPDATE CURRENT_TIMESTAMP.
Definition: field.h:718
@ GENERATED_FROM_EXPRESSION
DEFAULT (expression)
Definition: field.h:719
@ NONE
Definition: field.h:715
@ DEFAULT_NOW
DEFAULT CURRENT_TIMESTAMP.
Definition: field.h:717
@ NEXT_NUMBER
AUTO_INCREMENT.
Definition: field.h:716
String * val_int_as_str(String *val_buffer, bool unsigned_flag) const
Interpret field value as an integer but return the result as a string.
Definition: field.cc:1835
virtual uint32 data_length(ptrdiff_t row_offset=0) const
Definition: field.h:1090
virtual void set_image(const uchar *buff, size_t length, const CHARSET_INFO *)
Definition: field.h:1427
virtual bool has_charset() const
Definition: field.h:1637
virtual void set_derivation(enum Derivation)
Definition: field.h:1652
bool is_null_in_record(const uchar *record) const
Check if the Field has value NULL or the record specified by argument has value NULL for this Field.
Definition: field.h:1279
void reset_tmp_null()
Reset temporary NULL value for field.
Definition: field.h:921
virtual uchar * pack_with_metadata_bytes(uchar *to, const uchar *from, uint max_length) const
This function does the same thing as pack(), except for the difference that max_length does not mean ...
Definition: field.h:1553
virtual enum_field_types type() const =0
virtual bool zero_pack() const
Definition: field.h:1167
bool ignore_nulls() const
Definition: field.h:929
virtual void move_field_offset(ptrdiff_t ptr_diff)
Definition: field.h:1417
bool has_masking_policy() const
Does this column have a masking policy?
Definition: field.h:851
Key_map part_of_key
Keys that includes this field except of prefix keys.
Definition: field.h:694
virtual type_conversion_status store_packed(longlong nr)
Store a temporal value in packed longlong format into a field.
Definition: field.h:964
bool is_hidden_by_user() const
Definition: field.h:885
Field * new_field(MEM_ROOT *root, TABLE *new_table, uchar *new_ptr, uchar *new_null_ptr, uint new_null_bit) const
Definition: field.h:1385
bool handle_old_value() const
Whether field's old valued have to be handled.
Definition: field.h:1859
TABLE * table
Pointer to TABLE object that owns this field.
Definition: field.h:685
uint16 field_index() const
Returns field index.
Definition: field.h:1877
virtual type_conversion_status store(longlong nr, bool unsigned_val)=0
virtual bool get_timestamp(my_timeval *tm, int *warnings) const
Returns a UTC component in struct timeval format.
Definition: field.cc:2328
void move_field(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg)
Definition: field.h:1411
const uchar * unpack_int32(uchar *to, const uchar *from) const
Definition: field.cc:10427
virtual void init(TABLE *table_arg)
Definition: field.cc:10290
bool is_null(ptrdiff_t row_offset=0) const
Check whether the full table's row is NULL or the Field has value NULL.
Definition: field.h:1230
virtual my_decimal * val_decimal(my_decimal *) const =0
bool has_insert_default_datetime_value_expression() const
Checks if the field is marked as having a datetime value expression to generate default values on ins...
Definition: field.h:604
void evaluate_update_default_function()
Evaluates the UPDATE default function, if one exists, and stores the result in the record buffer.
Definition: field.cc:2405
LEX_CSTRING m_engine_attribute
Definition: field.h:798
void set_tmp_nullable()
Turn on temporary nullability for the field.
Definition: field.h:911
const uchar * unpack_int64(uchar *to, const uchar *from) const
Definition: field.cc:10438
virtual void set_field_index(uint16 field_index)
Sets field index.
Definition: field.h:1868
type_conversion_status check_constraints(int mysql_errno)
Check NOT NULL constraint on the field after temporary nullability is disabled.
Definition: field.cc:1888
Key_map part_of_prefixkey
Prefix keys.
Definition: field.h:696
bool is_real_null(ptrdiff_t row_offset=0) const
Check whether the Field has value NULL (temporary or actual).
Definition: field.h:1264
bool is_tmp_nullable() const
Definition: field.h:936
String * val_str(String *str, uchar *new_ptr)
Definition: field.h:1480
uchar null_bit
Definition: field.h:762
bool m_ignore_nulls
If true, Field class does not use NULL values, regardless of m_nullable.
Definition: field.h:667
virtual double val_real() const =0
virtual bool val_date(Date_val *date, my_time_flags_t flags) const
Retrieve field value and return the result as a date.
Definition: field.cc:2304
virtual bool can_be_compared_as_longlong() const
Definition: field.h:1380
virtual longlong val_int() const =0
uchar * pack_int32(uchar *to, const uchar *from, size_t max_length) const
Definition: field.cc:10421
bool m_is_tmp_nullable
Flag: if the NOT-NULL field can be temporary NULL.
Definition: field.h:651
virtual void make_send_field(Send_field *send_field) const
Populates a Send_field object with metadata about the column represented by this Field object.
Definition: field.cc:2146
virtual size_t make_sort_key(uchar *buff, size_t length) const =0
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comp...
virtual const CHARSET_INFO * sort_charset() const
Definition: field.h:1636
virtual Item_result numeric_context_result_type() const
Returns Item_result type of a field when it appears in numeric context such as: SELECT time_column + ...
Definition: field.h:1046
bool m_indexed
True if this field belongs to some index (unlike part_of_key, the index might have only a prefix).
Definition: field.h:796
void set_ignore_nulls()
Set field clause to ignore nullability. Affects debug code only.
Definition: field.h:926
virtual int cmp_binary_offset(ptrdiff_t row_offset) const
Definition: field.h:1205
virtual bool is_updatable() const
Checks whether a string field is part of write_set.
Definition: field.h:1813
virtual bool eq_def(const Field *field) const
Definition: field.cc:8529
const uchar * unpack(const uchar *from)
Definition: field.h:1535
geometry_type
Definition: field.h:722
@ GEOM_GEOMETRYCOLLECTION
Definition: field.h:730
@ GEOM_POLYGON
Definition: field.h:726
@ GEOM_MULTILINESTRING
Definition: field.h:728
@ GEOM_POINT
Definition: field.h:724
@ GEOM_MULTIPOINT
Definition: field.h:727
@ GEOM_MULTIPOLYGON
Definition: field.h:729
@ GEOM_LINESTRING
Definition: field.h:725
@ GEOM_GEOMETRY
Definition: field.h:723
virtual int cmp_max(const uchar *a, const uchar *b, uint max_len) const
Definition: field.h:1193
virtual bool val_time(Time_val *time) const
Retrieve field value and return the result as a time.
Definition: field.cc:2320
virtual Item_result result_type() const =0
uint32 flags
Definition: field.h:752
bool is_nullable() const
Definition: field.h:1305
bool warn_if_overflow(int op_result)
Process decimal library return codes and issue warnings for overflow and truncation.
Definition: field.cc:1817
static bool type_can_have_key_part(enum_field_types)
Check whether a field type can be partially indexed by a key.
Definition: field.cc:1645
bool set_warning(Sql_condition::enum_severity_level level, unsigned int code, int cut_increment)
Produce warning or note about data saved into field.
Definition: field.h:1675
virtual bool val_datetime(Datetime_val *dt, my_time_flags_t flags) const
Retrieve field value and return the result as a datetime/timestamp.
Definition: field.cc:2312
virtual type_conversion_status store(const char *to, size_t length, const CHARSET_INFO *cs)=0
LEX_CSTRING m_masking_policy
Holds the name of the masking policy applied to the field.
Definition: field.h:816
virtual geometry_type get_geometry_type() const
Definition: field.h:1716
uint null_offset(const uchar *record) const
Definition: field.h:1307
virtual bool is_text_key_type() const
Definition: field.h:1215
virtual String * val_str(String *, String *) const =0
virtual uchar * pack(uchar *to, const uchar *from, size_t max_length) const
Pack the field into a format suitable for storage and transfer.
Definition: field.cc:2070
static Item_result result_merge_type(enum_field_types)
Detect Item_result by given field type of UNION merge result.
Definition: field.cc:1522
virtual bool eq(const Field *field) const
Definition: field.h:1055
Field * new_key_field(MEM_ROOT *root, TABLE *new_table, uchar *new_ptr) const
Definition: field.h:1395
bool is_tmp_null() const
Definition: field.h:944
virtual uint32 key_length() const
Definition: field.h:1169
bool is_gcol() const
Definition: field.h:832
dd::Column::enum_hidden_type m_hidden
Definition: field.h:640
void set_storage_type(ha_storage_media storage_type_arg)
Definition: field.h:1741
static enum_field_types field_type_merge(enum_field_types, enum_field_types)
Return type of which can carry value of both given types in UNION result.
Definition: field.cc:1397
uchar * m_null_ptr
Byte where the NULL bit is stored inside a record.
Definition: field.h:646
virtual uint32 max_data_length() const
Get the maximum size of the data in packed format.
Definition: field.h:1100
virtual Item_result cmp_type() const
Definition: field.h:1049
column_format_type column_format() const
Definition: field.h:1746
virtual const uchar * unpack(uchar *to, const uchar *from, uint param_data)
Unpack a field from row data.
Definition: field.cc:2101
uchar auto_flags
Bitmap of flags indicating if field value is auto-generated by default and/or on update,...
Definition: field.h:772
bool is_hidden_by_system() const
Definition: field.h:875
virtual int cmp(const uchar *, const uchar *) const =0
String * val_str(String *str) const
Definition: field.h:1015
unsigned int m_warnings_pushed
Definition: field.h:813
void set_check_for_truncated_fields(enum_check_fields check_for_truncated_fields)
Remember the value of THD::check_for_truncated_fields to handle possible NOT-NULL constraint errors a...
Definition: field.h:1299
uchar * pack_int64(uchar *to, const uchar *from, size_t max_length) const
Definition: field.cc:10432
virtual longlong val_date_temporal_at_utc() const
Definition: field.h:1010
const char * orig_db_name
Pointer to original database name, only non-NULL for a temporary table.
Definition: field.h:687
uchar * get_null_ptr()
Definition: field.h:683
virtual uint32 char_length() const
Definition: field.h:1712
bool is_field_for_functional_index() const
Definition: field.h:896
virtual uint pack_length_from_metadata(uint field_metadata) const
Definition: field.h:1076
LEX_CSTRING m_secondary_engine_attribute
Definition: field.h:799
virtual int key_cmp(const uchar *str, uint length) const
Definition: field.h:1211
bool is_hidden() const
Definition: field.h:864
virtual void store_timestamp(const my_timeval *)
Stores a timestamp value in timeval format in a field.
Definition: field.h:1148
enum_check_fields m_check_for_truncated_fields_saved
The value of THD::check_for_truncated_fields at the moment of setting m_is_tmp_null attribute.
Definition: field.h:673
void evaluate_insert_default_function()
Evaluates the INSERT default function and stores the result in the field.
Definition: field.cc:2397
virtual int cmp_offset(ptrdiff_t row_offset) const
Definition: field.h:1202
bool is_created_from_null_item
If true, this field was created in create_tmp_field_from_item from a NULL value.
Definition: field.h:782
uint32 all_flags() const
Definition: field.h:761
int save_field_metadata(uchar *first_byte)
Definition: field.h:1081
virtual Field * clone(MEM_ROOT *mem_root) const =0
Makes a shallow copy of the Field object.
bool stored_in_db
Indication that the field is physically stored in tables rather than just generated on SQL queries.
Definition: field.h:826
virtual type_conversion_status store_time(Time_val time, uint8 dec_arg)
Store a time value into a string column.
Definition: field.cc:2045
virtual enum Derivation derivation() const
Definition: field.h:1650
virtual type_conversion_status store_date(Date_val date)
Store a date value into a string column.
Definition: field.cc:2059
uchar * ptr
Holds the position to the field in record.
Definition: field.h:637
static constexpr size_t MAX_MEDIUM_BLOB_WIDTH
Definition: field.h:740
virtual void set_field_length(uint32 length)
Definition: field.h:746
virtual int key_cmp(const uchar *a, const uchar *b) const
Definition: field.h:1208
virtual bool is_unsigned() const
Whether the field is signed or not.
Definition: field.h:831
bool has_update_default_datetime_value_expression() const
Checks if the field is marked as having a datetime value expression to generate default values on upd...
Definition: field.h:616
virtual enum_field_types binlog_type() const
Definition: field.h:1172
bool is_part_of_actual_key(THD *thd, uint cur_index, KEY *cur_index_info) const
Check whether field is part of the index taking the index extensions flag into account.
Definition: field.cc:9849
dd::Column::enum_hidden_type hidden() const
Definition: field.h:858
void dbug_print() const
Definition: field.h:1723
longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag, bool *has_overflow)
Conversion from decimal to longlong.
Definition: field.cc:2172
uchar * field_ptr()
Return a pointer to where the field is stored in the record buffer.
Definition: field.h:1801
virtual enum ha_base_keytype key_type() const
Definition: field.h:1168
virtual uint is_equal(const Create_field *new_field) const
Whether a field being created is type-compatible with an existing one.
Definition: field.cc:1384
virtual size_t get_key_image(uchar *buff, size_t length, imagetype type) const
Definition: field.h:1458
virtual void mem_free()
Definition: field.h:1381
virtual bool match_collation_to_optimize_range() const
Definition: field.h:1649
virtual uint repertoire() const
Definition: field.h:1651
virtual void hash(ulong *nr, ulong *nr2) const
Definition: field.cc:1955
bool has_insert_default_constant_expression() const
Checks if the field is marked as having a constant expression to generate default values.
Definition: field.h:628
virtual uint row_pack_length() const
Definition: field.h:1080
virtual bool is_wrapper_field() const
If true, it's a Create_field_wrapper (a sub-class of Field used during CREATE/ALTER that we mustn't c...
Definition: field.h:790
virtual void sql_type(String &str) const =0
virtual type_conversion_status reset()
Definition: field.h:1102
void set_flag(unsigned flag)
Definition: field.h:757
void set_masking_policy(LEX_CSTRING masking_policy)
Sets the name of the masking policy to apply to this column.
Definition: field.h:846
enum_pushed_warnings
Definition: field.h:802
@ NO_DEFAULT_FOR_FIELD_PUSHED
Definition: field.h:804
@ NO_DEFAULT_FOR_VIEW_FIELD_PUSHED
Definition: field.h:805
@ BAD_NULL_ERROR_PUSHED
Definition: field.h:803
virtual Field * new_field(MEM_ROOT *root, TABLE *new_table) const
Definition: field.cc:2358
void set_column_format(column_format_type column_format_arg)
Definition: field.h:1750
uint offset(uchar *record) const
Definition: field.h:1593
virtual void set_key_image(const uchar *buff, size_t length)
Definition: field.h:1463
bool is_flag_set(unsigned flag) const
Definition: field.h:756
Key_map part_of_key_not_extended
All keys that include this field, but not extended by the storage engine to include primary key colum...
Definition: field.h:702
longlong val_int_offset(ptrdiff_t row_offset)
Definition: field.h:1466
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:935
Represents a JSON array container, i.e.
Definition: json_dom.h:520
Vector of logical diffs describing changes to a JSON column.
Definition: json_diff.h:141
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1268
Definition: protocol.h:33
Definition: rpl_rli.h:208
const char * col_name
Definition: field.h:4573
ulong length
Definition: field.h:4574
uint charsetnr
Definition: field.h:4575
bool field
Definition: field.h:4582
enum_field_types type
Definition: field.h:4576
const char * db_name
Definition: field.h:4571
const char * org_table_name
Definition: field.h:4572
enum_severity_level
Enumeration value describing the severity of the condition.
Definition: sql_error.h:66
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:169
void takeover(String &s)
Takeover the buffer owned by another string.
Definition: sql_string.h:467
void mem_free()
Definition: sql_string.h:402
char * c_ptr_safe()
Returns a pointer to a C-style null-terminated string.
Definition: sql_string.h:290
const CHARSET_INFO * charset() const
Definition: sql_string.h:242
const char * ptr() const
Definition: sql_string.h:251
size_t length() const
Definition: sql_string.h:243
size_t alloced_length() const
Definition: sql_string.h:244
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Time_val is a temporal type that represents only time.
Definition: my_temporal.h:57
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t co...
Definition: tztime.h:49
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:481
void set_field_stored(bool stored)
Definition: field.h:534
void set_field_type(enum_field_types fld_type)
Definition: field.h:517
uint num_non_virtual_base_cols
How many non-virtual base columns in base_columns_map.
Definition: field.h:570
bool stored_in_db
Indicates if the field is physically stored in the database.
Definition: field.h:568
bool register_base_columns(TABLE *table)
Calculate the base_columns_map and num_non_virtual_base_cols members of this generated column.
Definition: table.cc:2568
enum_field_types field_type
Real field type.
Definition: field.h:566
void backup_stmt_unsafe_flags(uint32 backup_binlog_stmt_flags)
Set the binary log flags in m_backup_binlog_stmt_flags.
Definition: field.h:523
uint non_virtual_base_columns() const
Get the number of non virtual base columns that this generated column needs.
Definition: field.h:542
Item * expr_item
Item representing the generation expression.
Definition: field.h:491
void dup_expr_str(MEM_ROOT *root, const char *src, size_t len)
Duplicates a string into expr_str.
Definition: table.cc:2592
uint32 get_stmt_unsafe_flags()
Get the binary log flags from m_backup_binlog_stmt_flags.
Definition: field.h:531
MY_BITMAP base_columns_map
Bitmap records base columns which a generated column depends on.
Definition: field.h:513
uint32 m_backup_binlog_stmt_flags
Bit field indicating the type of statement for binary logging.
Definition: field.h:508
void print_expr(THD *thd, String *out)
Writes the generation expression into a String with proper syntax.
Definition: table.cc:2598
Item * item_list
List of all items created when parsing and resolving generated expression.
Definition: field.h:511
bool get_field_stored() const
Definition: field.h:533
enum_field_types get_real_type() const
Definition: field.h:515
LEX_STRING expr_str
Text of the expression.
Definition: field.h:499
enum_hidden_type
Definition: column.h:96
@ HT_HIDDEN_SQL
The column is visible to the server, but hidden from the user.
@ HT_HIDDEN_SE
The column is completely invisible to the server.
@ HT_VISIBLE
The column is visible (a normal column)
@ HT_HIDDEN_USER
User table column marked as INVISIBLE by using the column visibility attribute.
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:97
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
#define L
Definition: ctype-tis620.cc:74
uint64_t sql_mode_t
Definition: dd_event.h:39
#define E_DEC_TRUNCATED
Definition: decimal.h:148
#define E_DEC_DIV_ZERO
Definition: decimal.h:150
#define E_DEC_BAD_NUM
Definition: decimal.h:151
#define E_DEC_OK
Definition: decimal.h:147
#define E_DEC_OOM
Definition: decimal.h:152
#define E_DEC_OVERFLOW
Definition: decimal.h:149
static constexpr int DECIMAL_NOT_SPECIFIED
Definition: dtoa.h:54
This file contains basic method for field types.
bool is_temporal_type(enum_field_types type)
Tests if field type is temporal, i.e.
Definition: field_common_properties.h:139
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:56
@ MYSQL_TYPE_TIME2
Internal to MySQL.
Definition: field_types.h:76
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:72
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:65
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:87
@ MYSQL_TYPE_BLOB
Definition: field_types.h:88
@ MYSQL_TYPE_TINY
Definition: field_types.h:58
@ MYSQL_TYPE_TIME
Definition: field_types.h:68
@ MYSQL_TYPE_SET
Definition: field_types.h:84
@ MYSQL_TYPE_NEWDATE
Internal to MySQL.
Definition: field_types.h:71
@ MYSQL_TYPE_VECTOR
Definition: field_types.h:78
@ MYSQL_TYPE_JSON
Definition: field_types.h:81
@ MYSQL_TYPE_STRING
Definition: field_types.h:90
@ MYSQL_TYPE_NULL
Definition: field_types.h:63
@ MYSQL_TYPE_ENUM
Definition: field_types.h:83
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:85
@ MYSQL_TYPE_LONG
Definition: field_types.h:60
@ MYSQL_TYPE_BIT
Definition: field_types.h:73
@ MYSQL_TYPE_INVALID
Definition: field_types.h:79
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:91
@ MYSQL_TYPE_NEWDECIMAL
Definition: field_types.h:82
@ MYSQL_TYPE_DECIMAL
Definition: field_types.h:57
@ MYSQL_TYPE_TYPED_ARRAY
Used for replication only.
Definition: field_types.h:77
@ MYSQL_TYPE_DOUBLE
Definition: field_types.h:62
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_DATETIME2
Internal to MySQL.
Definition: field_types.h:75
@ MYSQL_TYPE_SHORT
Definition: field_types.h:59
@ MYSQL_TYPE_DATE
Definition: field_types.h:67
@ MYSQL_TYPE_FLOAT
Definition: field_types.h:61
@ MYSQL_TYPE_TIMESTAMP
Definition: field_types.h:64
@ MYSQL_TYPE_INT24
Definition: field_types.h:66
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:69
@ MYSQL_TYPE_TIMESTAMP2
Definition: field_types.h:74
@ MYSQL_TYPE_YEAR
Definition: field_types.h:70
static const std::string dec("DECRYPTION")
#define ENUM_FLAG
field is an enum
Definition: mysql_com.h:164
#define FIELD_FLAGS_COLUMN_FORMAT
Field column format, bit 24-25.
Definition: mysql_com.h:186
#define BLOB_FLAG
Field is a blob.
Definition: mysql_com.h:158
#define SET_FLAG
field is a set
Definition: mysql_com.h:167
#define BINARY_FLAG
Field is binary
Definition: mysql_com.h:161
#define FIELD_FLAGS_STORAGE_MEDIA
Field storage media, bit 22-23.
Definition: mysql_com.h:184
static int flag
Definition: hp_test1.cc:40
static int rnd(int max_value)
Definition: hp_test2.cc:551
enum_mysql_timestamp_type
Definition: mysql_time.h:45
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:49
A better implementation of the UNIX ctype(3) library.
static constexpr uint32_t MY_REPERTOIRE_UNICODE30
Definition: m_ctype.h:156
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:499
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_utf8mb4_bin
Definition: ctype-utf8.cc:7813
MYSQL_STRINGS_EXPORT unsigned my_charset_repertoire(const CHARSET_INFO *cs)
Definition: ctype.cc:821
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
This file includes constants used by all storage engines.
ha_base_keytype
Definition: my_base.h:444
@ HA_KEYTYPE_VARBINARY2
Definition: my_base.h:465
@ HA_KEYTYPE_BINARY
Definition: my_base.h:447
@ HA_KEYTYPE_USHORT_INT
Definition: my_base.h:453
@ HA_KEYTYPE_ULONGLONG
Definition: my_base.h:456
@ HA_KEYTYPE_UINT24
Definition: my_base.h:458
@ HA_KEYTYPE_VARTEXT2
Definition: my_base.h:464
@ HA_KEYTYPE_FLOAT
Definition: my_base.h:450
@ HA_KEYTYPE_BIT
Definition: my_base.h:466
@ HA_KEYTYPE_ULONG_INT
Definition: my_base.h:454
@ HA_KEYTYPE_SHORT_INT
Definition: my_base.h:448
@ HA_KEYTYPE_NUM
Definition: my_base.h:452
@ HA_KEYTYPE_DOUBLE
Definition: my_base.h:451
@ HA_KEYTYPE_LONG_INT
Definition: my_base.h:449
@ HA_KEYTYPE_INT8
Definition: my_base.h:459
@ HA_KEYTYPE_INT24
Definition: my_base.h:457
@ HA_KEYTYPE_TEXT
Definition: my_base.h:446
@ HA_KEYTYPE_LONGLONG
Definition: my_base.h:455
ha_storage_media
Definition: my_base.h:116
@ HA_SM_DEFAULT
Definition: my_base.h:117
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
#define DBUG_FILE
Definition: my_dbug.h:194
#define DBUG_EVALUATE_IF(keyword, a1, a2)
Definition: my_dbug.h:179
#define DBUG_TRACE
Definition: my_dbug.h:146
Utility functions for converting between ulonglong and double.
static constexpr double LLONG_MAX_DOUBLE
Definition: my_double2ulonglong.h:57
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
#define MY_INT32_NUM_DECIMAL_DIGITS
Definition: my_inttypes.h:100
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
Server classes for temporal handling (DATE, TIME, DATETIME)
Interface for low level time utilities.
constexpr const my_time_flags_t TIME_NO_INVALID_DATES
Don't allow invalid dates like 2000-02-31.
Definition: my_time.h:108
constexpr const my_time_flags_t TIME_NO_ZERO_IN_DATE
Don't allow zero day or zero month.
Definition: my_time.h:102
constexpr const int MYSQL_TIME_WARN_INVALID_TIMESTAMP
Definition: my_time.h:123
constexpr const int MYSQL_TIME_NOTE_TRUNCATED
Definition: my_time.h:125
constexpr const int MYSQL_TIME_WARN_TRUNCATED
Conversion warnings.
Definition: my_time.h:121
constexpr const my_time_flags_t TIME_NO_ZERO_DATE
Don't allow 0000-00-00 date.
Definition: my_time.h:105
constexpr const int DATETIME_MAX_DECIMALS
Definition: my_time.h:146
constexpr const int MYSQL_TIME_WARN_ZERO_IN_DATE
Definition: my_time.h:126
constexpr const int MYSQL_TIME_WARN_OUT_OF_RANGE
Definition: my_time.h:122
unsigned int my_time_flags_t
Flags to str_to_datetime and int_to_datetime.
Definition: my_time.h:87
constexpr const int MYSQL_TIME_WARN_ZERO_DATE
Definition: my_time.h:124
constexpr const my_time_flags_t TIME_FRAC_TRUNCATE
Whether to truncate or round fractional time component.
Definition: my_time.h:96
unsigned int STDCALL mysql_errno(MYSQL *mysql)
Definition: client.cc:9483
Common definition between mysql server & client.
static int interval
Definition: mysqladmin.cc:72
static int record
Definition: mysqltest.cc:195
void copy(Shards< COUNT > &dst, const Shards< COUNT > &src) noexcept
Copy the counters, overwrite destination.
Definition: ut0counter.h:354
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1077
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
constexpr value_type zerofill
Definition: classic_protocol_constants.h:274
constexpr value_type is_unsigned
Definition: classic_protocol_constants.h:273
static PFS_engine_table_share_proxy share
Definition: connection_control_pfs_table.cc:95
Definition: applier_version.h:27
enum_column_types
Definition: column.h:53
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
RangeReverse< Range > reverse(Range &x)
Iterate over a range in reverse.
Definition: utilities.h:132
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
std::string truncate(const std::string &str, const size_t max_length)
Truncates the given string to max_length code points.
Definition: utils_string.cc:600
mode
Definition: file_handle.h:61
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2732
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
required string type
Definition: replication_group_member_actions.proto:34
static void make_hash_key(const char *username, const char *hostname, std::string &key)
Make hash key.
Definition: sha2_password.cc:944
Create_field * generate_create_field(THD *thd, Item *source_item, TABLE *tmp_table)
Generate a Create_field from an Item.
Definition: field.cc:10536
bool is_temporal_real_type(enum_field_types type)
Tests if field real type is temporal, i.e.
Definition: field.h:347
Field * make_field(MEM_ROOT *mem_root_arg, TABLE_SHARE *share, uchar *ptr, size_t field_length, uchar *null_pos, uchar null_bit, enum_field_types field_type, const CHARSET_INFO *field_charset, Field::geometry_type geom_type, uchar auto_flags, TYPELIB *interval, const char *field_name, bool is_nullable, bool is_zerofill, bool is_unsigned, uint decimals, bool treat_bit_as_char, uint pack_length_override, std::optional< gis::srid_t > srid, bool is_array)
This function should only be called from legacy code.
Definition: field.cc:9396
type_conversion_status
Status when storing a value in a field or converting from one datatype to another.
Definition: field.h:200
@ TYPE_ERR_BAD_VALUE
Store/convert incompatible values, like converting "foo" to a date.
Definition: field.h:243
@ TYPE_OK
Storage/conversion went fine.
Definition: field.h:202
@ TYPE_NOTE_TIME_TRUNCATED
A minor problem when converting between temporal values, e.g.
Definition: field.h:207
@ TYPE_ERR_OOM
Out of memory.
Definition: field.h:245
@ TYPE_NOTE_TRUNCATED
Value was stored, but something was cut.
Definition: field.h:217
@ TYPE_ERR_NULL_CONSTRAINT_VIOLATION
Trying to store NULL in a NOT NULL field.
Definition: field.h:238
@ TYPE_WARN_OUT_OF_RANGE
Value outside min/max limit of datatype.
Definition: field.h:222
@ TYPE_WARN_TRUNCATED
Value was stored, but something was cut.
Definition: field.h:231
@ TYPE_WARN_INVALID_STRING
Value has invalid string data.
Definition: field.h:236
enum_check_fields
Definition: field.h:169
@ CHECK_FIELD_ERROR_FOR_NULL
Definition: field.h:172
@ CHECK_FIELD_IGNORE
Definition: field.h:170
@ CHECK_FIELD_WARN
Definition: field.h:171
void copy_integer(uchar *to, size_t to_length, const uchar *from, size_t from_length, bool is_unsigned)
Copies an integer value to a format comparable with memcmp().
Definition: field.h:450
type_conversion_status set_field_to_null_with_conversions(Field *field, bool no_conversions)
Set field to NULL or TIMESTAMP or to next auto_increment number.
Definition: field_conv.cc:154
uint32 calc_key_length(enum_field_types sql_type, uint32 length, uint32 decimals, bool is_unsigned, uint32 elements)
Calculate key length for field from its type, length and other attributes.
Definition: field.cc:9234
bool pre_validate_value_generator_expr(Item *expression, const char *name, Value_generator_source source)
Perform per item-type checks to determine if the expression is allowed for a generated column,...
Definition: field.cc:1341
#define MY_REPERTOIRE_NUMERIC
Definition: field.h:256
enum_field_types real_type_to_type(enum_field_types real_type)
Convert temporal real types as returned by field->real_type() to field type as returned by field->typ...
Definition: field.h:391
Value_generator_source
Enum to indicate source for which value generator is used.
Definition: field.h:471
@ VGS_DEFAULT_EXPRESSION
Definition: field.h:473
@ VGS_CHECK_CONSTRAINT
Definition: field.h:474
@ VGS_GENERATED_COLUMN
Definition: field.h:472
type_conversion_status decimal_err_to_type_conv_status(int dec_error)
Definition: field.h:292
enum_field_types blob_type_from_pack_length(uint pack_length)
Return the appropriate MYSQL_TYPE_X_BLOB value based on the pack_length.
Definition: field.h:414
uint get_set_pack_length(int elements)
Definition: field.h:287
bool fields_are_memcpyable(const Field *to, const Field *from)
Check if one can copy from “from” to “to” with a simple memcpy(), with pack_length() as the length.
Definition: field_conv.cc:730
#define my_charset_numeric
Definition: field.h:255
type_conversion_status set_field_to_null(Field *field)
Definition: field_conv.cc:94
uint get_enum_pack_length(int elements)
Definition: field.h:283
size_t calc_pack_length(enum_field_types type, size_t length)
Definition: field.cc:9277
type_conversion_status field_conv_slow(Field *to, const Field *from)
Copy the value in "from" (assumed to be non-NULL) to "to", doing any required conversions in the proc...
Definition: field_conv.cc:791
bool is_blob(enum_field_types sql_type)
Definition: field.h:4686
const char * get_field_name_or_expression(THD *thd, const Field *field)
Definition: field.cc:10624
#define portable_sizeof_char_ptr
Definition: field.h:119
column_format_type
Definition: field.h:188
@ COLUMN_FORMAT_TYPE_DEFAULT
Definition: field.h:189
@ COLUMN_FORMAT_TYPE_FIXED
Definition: field.h:190
@ COLUMN_FORMAT_TYPE_DYNAMIC
Definition: field.h:191
type_conversion_status time_warning_to_type_conversion_status(const int warn)
Convert warnings returned from str_to_time() and str_to_datetime() to their corresponding type_conver...
Definition: field.h:312
type_conversion_status store_internal_with_error_check(Field_new_decimal *field, int conversion_err, my_decimal *value)
Definition: field.cc:3138
enum_field_types get_blob_type_from_length(size_t length)
Definition: field.cc:9264
bool real_type_with_now_as_default(enum_field_types type)
Tests if field real type can have "DEFAULT CURRENT_TIMESTAMP", i.e.
Definition: field.h:366
bool real_type_with_now_on_update(enum_field_types type)
Tests if field real type can have "ON UPDATE CURRENT_TIMESTAMP", i.e.
Definition: field.h:379
Derivation
For use.
Definition: field.h:176
@ DERIVATION_UNUSED
Definition: field.h:183
@ DERIVATION_COERCIBLE
Definition: field.h:180
@ DERIVATION_SYSCONST
Definition: field.h:181
@ DERIVATION_EXPLICIT
Definition: field.h:184
@ DERIVATION_NONE
Definition: field.h:177
@ DERIVATION_NUMERIC
Definition: field.h:179
@ DERIVATION_NULL
Definition: field.h:178
@ DERIVATION_IMPLICIT
Definition: field.h:182
File containing constants that can be used throughout the server.
constexpr const int MAX_TIME_WIDTH
-838:59:59
Definition: sql_const.h:70
constexpr const int MAX_DATE_WIDTH
YYYY-MM-DD.
Definition: sql_const.h:68
constexpr const int MAX_DATETIME_WIDTH
YYYY-MM-DD HH:MM:SS.
Definition: sql_const.h:76
Our own string classes, used pervasively throughout the executor.
Truncate_result
Definition: sql_truncate.cc:140
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
unsigned mbmaxlen
Definition: m_ctype.h:445
MY_CHARSET_HANDLER * cset
Definition: m_ctype.h:453
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
size_t length
Definition: mysql_lex_string.h:42
Definition: mysql_lex_string.h:35
Structure to return status from str_to_datetime(), str_to_time(), int_to_datetime(),...
Definition: my_time.h:173
Definition: mysql_time.h:82
Definition: my_bitmap.h:43
size_t(* lengthsp)(const CHARSET_INFO *, const char *ptr, size_t length)
Given a pointer and a length in bytes, returns a new length in bytes where all trailing space charact...
Definition: m_ctype.h:372
void(* fill)(const CHARSET_INFO *, char *to, size_t len, int fill)
Definition: m_ctype.h:399
This structure is shared between different table objects.
Definition: table.h:731
bool has_null_row() const
Definition: table.h:2228
bool is_nullable() const
Return whether table is nullable.
Definition: table.h:2130
A structure to store a decimal value together with its precision and number of decimals TODO: HCS-100...
Definition: protocol_local_v2.h:43
Replacement of system's struct timeval to ensure we can carry 64 bit values even on a platform which ...
Definition: my_time_t.h:45
constexpr sql_mode_t MODE_INVALID_DATES
Definition: system_variables.h:148
constexpr sql_mode_t MODE_TIME_TRUNCATE_FRACTIONAL
Definition: system_variables.h:161
constexpr sql_mode_t MODE_NO_ZERO_IN_DATE
Definition: system_variables.h:146
constexpr sql_mode_t MODE_NO_ZERO_DATE
Definition: system_variables.h:147
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:41
@ DECIMAL_RESULT
not valid for UDFs
Definition: udf_registration_types.h:45
@ REAL_RESULT
char *
Definition: udf_registration_types.h:42
@ INT_RESULT
double
Definition: udf_registration_types.h:43