summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-06-04 16:21:19 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-06-04 16:21:19 +0300
commit5321e49da6b2634d7f32a6a51da5900cb6f233cf (patch)
tree84dac453baa2a878b6dcb1c5ece486502e0d2180 /sql/sql_class.h
parentf9823c024ead129e7a21f7b7e57415306cb75347 (diff)
downloadmariadb-git-5321e49da6b2634d7f32a6a51da5900cb6f233cf.tar.gz
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.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index ac058bca4f9..c195c8be864 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -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;