diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-12-19 16:48:28 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-12-19 16:48:28 +0200 |
commit | 8d70097c216081e8013a548bfbde156e48985816 (patch) | |
tree | 4cca4f27d804ab261db2ee996f084fb5137833df /sql/field.h | |
parent | 079c3599711b9cbd3ce323f32cf99693cc3d5e3b (diff) | |
parent | 252e690c859b53c51c7eecf072f33dbaaa01bcdf (diff) | |
download | mariadb-git-8d70097c216081e8013a548bfbde156e48985816.tar.gz |
Merge 10.1 to 10.2
Follow-up fix to MDEV-14008: Let Field_double::val_uint() silently
return 0 on error
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/field.h b/sql/field.h index 1d0ce8c74cf..aeef0fa0a65 100644 --- a/sql/field.h +++ b/sql/field.h @@ -851,6 +851,10 @@ public: { return store(ls->str, (uint32) ls->length, cs); } virtual double val_real(void)=0; virtual longlong val_int(void)=0; + virtual ulonglong val_uint(void) + { + return (ulonglong) val_int(); + } virtual bool val_bool(void)= 0; virtual my_decimal *val_decimal(my_decimal *); inline String *val_str(String *str) { return val_str(str, str); } @@ -2175,6 +2179,7 @@ private: class Field_double :public Field_real { + longlong val_int_from_real(bool want_unsigned_result); public: Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, @@ -2211,13 +2216,8 @@ public: int store(longlong nr, bool unsigned_val); int reset(void) { bzero(ptr,sizeof(double)); return 0; } double val_real(void); - longlong val_int(void) - { - Converter_double_to_longlong conv(Field_double::val_real(), false); - if (conv.error()) - conv.push_warning(get_thd(), Field_double::val_real(), false); - return conv.result(); - } + longlong val_int(void) { return val_int_from_real(false); } + ulonglong val_uint(void) { return (ulonglong) val_int_from_real(true); } String *val_str(String*,String *); bool send_binary(Protocol *protocol); int cmp(const uchar *,const uchar *); |