summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-06-17 17:31:51 +0400
committerKonstantin Osipov <kostja@sun.com>2010-06-17 17:31:51 +0400
commitcc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1 (patch)
tree9413ba739bc0dbf1e647293756a3503f17dcde07 /sql/sys_vars.cc
parent91a7b147056a228804f81726127035aa305702ff (diff)
parent45c7bf3c54fa852b312773688fdce15bffe49abf (diff)
downloadmariadb-git-cc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1.tar.gz
Merge trunk-bugfixing -> trunk-runtime
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index e829d0784e9..7eb9a72273b 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2393,12 +2393,33 @@ static ulonglong read_timestamp(THD *thd)
{
return (ulonglong) thd->start_time;
}
+
+
+static bool check_timestamp(sys_var *self, THD *thd, set_var *var)
+{
+ time_t val;
+
+ if (!var->value)
+ return FALSE;
+
+ val= (time_t) var->save_result.ulonglong_value;
+ if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX)
+ {
+ my_message(ER_UNKNOWN_ERROR,
+ "This version of MySQL doesn't support dates later than 2038",
+ MYF(0));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
static Sys_var_session_special Sys_timestamp(
"timestamp", "Set the time for this client",
sys_var::ONLY_SESSION, NO_CMD_LINE,
VALID_RANGE(0, ~(time_t)0), BLOCK_SIZE(1),
- NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_timestamp),
- ON_READ(read_timestamp));
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_timestamp),
+ ON_UPDATE(update_timestamp), ON_READ(read_timestamp));
static bool update_last_insert_id(THD *thd, set_var *var)
{