diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:39:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:39:13 +0000 |
commit | 86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch) | |
tree | 28c9e526ea739c6f9b89e36115e1e2698bddf981 /sql/field.h | |
parent | Releasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff) | |
download | mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip |
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/sql/field.h b/sql/field.h index c456b2e7..8563375f 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1657,6 +1657,7 @@ public: void print_key_value_binary(String *out, const uchar* key, uint32 length); void raise_note_cannot_use_key_part(THD *thd, uint keynr, uint part, const LEX_CSTRING &op, + CHARSET_INFO *op_collation, Item *value, const Data_type_compatibility reason) const; @@ -1836,6 +1837,16 @@ public: return flags & (VERS_ROW_START | VERS_ROW_END); } + bool vers_sys_start() const + { + return flags & VERS_ROW_START; + } + + bool vers_sys_end() const + { + return flags & VERS_ROW_END; + } + bool vers_update_unversioned() const { return flags & VERS_UPDATE_UNVERSIONED_FLAG; @@ -2137,7 +2148,7 @@ public: const LEX_CSTRING *field_name_arg, const DTCollation &collation); decimal_digits_t decimals() const override - { return is_created_from_null_item ? 0 : NOT_FIXED_DEC; } + { return is_created_from_null_item ? 0 : DECIMAL_NOT_SPECIFIED; } int save_in_field(Field *to) override { return save_in_field_str(to); } bool memcpy_field_possible(const Field *from) const override { @@ -2307,7 +2318,7 @@ public: Information_schema_numeric_attributes information_schema_numeric_attributes() const override { - return dec == NOT_FIXED_DEC ? + return dec == DECIMAL_NOT_SPECIFIED ? Information_schema_numeric_attributes(field_length) : Information_schema_numeric_attributes(field_length, dec); } @@ -2879,15 +2890,24 @@ public: integers. But in all other cases we treat it as TIME_RESULT! */ }; +static inline decimal_digits_t fix_dec_arg(decimal_digits_t dec_arg) +{ return dec_arg >= FLOATING_POINT_DECIMALS ? DECIMAL_NOT_SPECIFIED : dec_arg; } class Field_float final :public Field_real { public: Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg); + decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + fix_dec_arg(dec_arg), zero_arg, unsigned_arg) + { } Field_float(uint32 len_arg, bool maybe_null_arg, - const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg); + const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0, + NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0) + { } const Type_handler *type_handler() const override { return &type_handler_float; } enum ha_base_keytype key_type() const override { return HA_KEYTYPE_FLOAT; } @@ -2920,12 +2940,24 @@ public: Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg); + decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + fix_dec_arg(dec_arg), zero_arg, unsigned_arg) + { } Field_double(uint32 len_arg, bool maybe_null_arg, - const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg); + const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0) + { } Field_double(uint32 len_arg, bool maybe_null_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg, bool not_fixed_arg); + decimal_digits_t dec_arg, bool not_fixed_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, fix_dec_arg(dec_arg), 0, 0) + { + not_fixed= not_fixed_arg; + } void init_for_tmp_table(Field *org_field, TABLE *new_table) override { Field::init_for_tmp_table(org_field, new_table); @@ -4056,6 +4088,8 @@ public: String *val_str(String *, String *) override; my_decimal *val_decimal(my_decimal *) override; int cmp(const uchar *,const uchar *) const override; + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const + override; void sort_string(uchar *buff,uint length) override; void update_data_type_statistics(Data_type_statistics *st) const override { @@ -4078,9 +4112,6 @@ public: bool compatible_field_size(uint field_metadata, const Relay_log_info *rli, uint16 mflags, int *order_var) const override; uint row_pack_length() const override { return field_length; } - int pack_cmp(const uchar *a,const uchar *b,uint key_length, - bool insert_or_update); - int pack_cmp(const uchar *b,uint key_length,bool insert_or_update); uint packed_col_length(const uchar *to, uint length) override; uint max_packed_col_length(uint max_length) override; uint size_of() const override { return sizeof *this; } |