diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-10-02 22:35:13 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-10-02 22:35:13 +0400 |
commit | 8ae8cd63485eb063de0b70ea6f3acf7102a61fef (patch) | |
tree | 70fa448baa769b6c8c331063a61bf929ad61c976 /sql/field.cc | |
parent | 6857cb57fe7090f131b272f31485b7a478a0b324 (diff) | |
parent | 387bdf07ae0973bc3e4dc3f5064d2a29c64bb769 (diff) | |
download | mariadb-git-8ae8cd63485eb063de0b70ea6f3acf7102a61fef.tar.gz |
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sql/field.cc b/sql/field.cc index acf0af095a1..c7aa0dce16e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5434,7 +5434,7 @@ int Field_temporal_with_date::store(double nr) ErrConvDouble str(nr); longlong tmp= double_to_datetime(nr, <ime, - sql_mode_for_dates(thd), &error); + (uint) sql_mode_for_dates(thd), &error); return store_TIME_with_warning(<ime, &str, error, tmp != -1); } @@ -7813,7 +7813,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) DBUG_ASSERT(length <= max_data_length()); new_length= length; - copy_length= table->in_use->variables.group_concat_max_len; + copy_length= (uint)MY_MIN(UINT_MAX,table->in_use->variables.group_concat_max_len); if (new_length > copy_length) { new_length= Well_formed_prefix(cs, @@ -8243,8 +8243,8 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *from, const uchar *from_end, uint param_data) { DBUG_ENTER("Field_blob::unpack"); - DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx; param_data: %u", - (ulong) to, (ulong) from, param_data)); + DBUG_PRINT("enter", ("to: %p; from: %p; param_data: %u", + to, from, param_data)); uint const master_packlength= param_data > 0 ? param_data & 0xFF : packlength; if (from + master_packlength > from_end) @@ -8378,7 +8378,7 @@ uint gis_field_options_read(const uchar *buf, uint buf_len, } end_of_record: - return cbuf - buf; + return (uint)(cbuf - buf); } @@ -9109,8 +9109,8 @@ Field_bit::do_last_null_byte() const bits. On systems with CHAR_BIT > 8 (not very common), the storage will lose the extra bits. */ - DBUG_PRINT("test", ("bit_ofs: %d, bit_len: %d bit_ptr: 0x%lx", - bit_ofs, bit_len, (long) bit_ptr)); + DBUG_PRINT("test", ("bit_ofs: %d, bit_len: %d bit_ptr: %p", + bit_ofs, bit_len, bit_ptr)); uchar *result; if (bit_len == 0) result= null_ptr; @@ -9794,7 +9794,7 @@ void Column_definition::create_length_to_internal_length_bit() } else { - pack_length= length / 8; + pack_length= (uint) length / 8; /* We need one extra byte to store the bits we save among the null bits */ key_length= pack_length + MY_TEST(length & 7); } @@ -9804,7 +9804,7 @@ void Column_definition::create_length_to_internal_length_bit() void Column_definition::create_length_to_internal_length_newdecimal() { key_length= pack_length= - my_decimal_get_binary_size(my_decimal_length_to_precision(length, + my_decimal_get_binary_size(my_decimal_length_to_precision((uint) length, decimals, flags & UNSIGNED_FLAG), @@ -9911,9 +9911,9 @@ bool Column_definition::fix_attributes_decimal() my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name.str); return true; } - length= my_decimal_precision_to_length(length, decimals, + length= my_decimal_precision_to_length((uint) length, decimals, flags & UNSIGNED_FLAG); - pack_length= my_decimal_get_binary_size(length, decimals); + pack_length= my_decimal_get_binary_size((uint) length, decimals); return false; } @@ -9922,7 +9922,7 @@ bool Column_definition::fix_attributes_bit() { if (!length) length= 1; - pack_length= (length + 7) / 8; + pack_length= ((uint) length + 7) / 8; return check_length(ER_TOO_BIG_DISPLAYWIDTH, MAX_BIT_FIELD_LENGTH); } @@ -10020,7 +10020,7 @@ bool Column_definition::check(THD *thd) DBUG_RETURN(true); /* Remember the value of length */ - char_length= length; + char_length= (uint)length; /* Set NO_DEFAULT_VALUE_FLAG if this field doesn't have a default value and @@ -10410,7 +10410,7 @@ Column_definition::Column_definition(THD *thd, Field *old_field, interval_list.empty(); // prepare_interval_field() needs this - char_length= length; + char_length= (uint)length; /* Copy the default (constant/function) from the column object orig_field, if @@ -10730,7 +10730,7 @@ bool Field::save_in_field_default_value(bool view_error_processing) { my_message(ER_CANT_CREATE_GEOMETRY_OBJECT, ER_THD(thd, ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0)); - return -1; + return true; } if (view_error_processing) @@ -10749,13 +10749,13 @@ bool Field::save_in_field_default_value(bool view_error_processing) ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD), field_name.str); } - return 1; + return true; } set_default(); return !is_null() && validate_value_in_record_with_warn(thd, table->record[0]) && - thd->is_error() ? -1 : 0; + thd->is_error(); } |