From bc4409ab4ee3729f09151a4d7bdc6d95fdcaa3a1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Sep 2017 01:12:00 +0200 Subject: MDEV-13868 cannot insert 1288481126 in a timestamp column in Europe/Moscow make insert NULL into a timestamp mark the field as having an explicit value. So that the field won't be assigned the value again in TABLE::update_default_field() make Item_func_now_local::save_in_field(timestamp_field) not to go through MYSQL_TIME - this conversion is lossy around DST change times. This fixes inserting a default value into a timestamp field. --- sql/item_timefunc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/item_timefunc.h') diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index b0a083bf24f..dccccc479ef 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -748,6 +748,7 @@ class Item_func_now_local :public Item_func_now public: Item_func_now_local(THD *thd, uint dec): Item_func_now(thd, dec) {} const char *func_name() const { return "current_timestamp"; } + int save_in_field(Field *field, bool no_conversions); virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); virtual enum Functype functype() const { return NOW_FUNC; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) -- cgit v1.2.1