1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug #52315: utc_date() crashes when system time > year 2037

Some of the server implementations don't support dates later
than 2038 due to the internal time type being 32 bit.
Added checks so that the server will refuse dates that cannot
be handled by either throwing an error when setting date at 
runtime or by refusing to start or shutting down the server if 
the system date cannot be stored in my_time_t.
This commit is contained in:
Georgi Kodinov
2010-06-04 16:21:19 +03:00
parent bd9fa7da26
commit 121e04732e
7 changed files with 66 additions and 1 deletions

View File

@ -1707,6 +1707,11 @@ public:
inline void end_time() { safe_time(&start_time); }
inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; }
inline void lock_time() { safe_time(&time_after_lock); }
/*TODO: this will be obsolete when we have support for 64 bit my_time_t */
inline bool is_valid_time()
{
return (start_time < (time_t) MY_TIME_T_MAX);
}
inline void insert_id(ulonglong id_arg)
{
last_insert_id= id_arg;