diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-12-08 19:39:23 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-12-10 19:25:12 +0400 |
commit | 34eb98387f8f46a80fb053081dbe20d415f23b39 (patch) | |
tree | 674bfd44acc89e741c26d788e614aa95a69c9936 /sql/field.h | |
parent | 5b3db87134bb0af2f04027c42971e560fbbf04ab (diff) | |
download | mariadb-git-34eb98387f8f46a80fb053081dbe20d415f23b39.tar.gz |
MDEV-13995 MAX(timestamp) returns a wrong result near DST change
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index 19ab24bc2cb..f18ed9506f3 100644 --- a/sql/field.h +++ b/sql/field.h @@ -790,6 +790,15 @@ public: return store_timestamp_dec(Timeval(timestamp, sec_part), TIME_SECOND_PART_DIGITS); } + /** + Store a value represented in native format + */ + virtual int store_native(const Native &value) + { + DBUG_ASSERT(0); + reset(); + return 0; + } int store_time(const MYSQL_TIME *ltime) { return store_time_dec(ltime, TIME_SECOND_PART_DIGITS); } int store(const char *to, size_t length, CHARSET_INFO *cs, @@ -836,6 +845,11 @@ public: This trickery is used to decrease a number of malloc calls. */ virtual String *val_str(String*,String *)=0; + virtual bool val_native(Native *to) + { + DBUG_ASSERT(!is_null()); + return to->copy((const char *) ptr, pack_length()); + } String *val_int_as_str(String *val_buffer, bool unsigned_flag); /* Return the field value as a LEX_CSTRING, without padding to full length @@ -2735,6 +2749,7 @@ protected: { store_TIMEVAL(ts.tv()); } + int zero_time_stored_return_code_with_warning(); public: Field_timestamp(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, @@ -2785,6 +2800,8 @@ public: store_TIMESTAMP(Timestamp(ts, sec_part).round(decimals(), mode, &warn)); } bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate); + int store_native(const Native &value); + bool val_native(Native *to); uchar *pack(uchar *to, const uchar *from, uint max_length __attribute__((unused))) { @@ -2864,6 +2881,7 @@ public: { DBUG_ASSERT(dec); } + bool val_native(Native *to); my_time_t get_timestamp(const uchar *pos, ulong *sec_part) const; int cmp(const uchar *,const uchar *); uint32 pack_length() const { return 4 + sec_part_bytes(dec); } @@ -2914,6 +2932,7 @@ public: { return get_timestamp(ptr, sec_part); } + bool val_native(Native *to); uint size_of() const { return sizeof(*this); } }; |