1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-13995 MAX(timestamp) returns a wrong result near DST change

This commit is contained in:
Alexander Barkov
2018-12-08 19:39:23 +04:00
parent 5b3db87134
commit 34eb98387f
26 changed files with 1850 additions and 16 deletions

View File

@ -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); }
};