summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-22 01:12:00 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-22 13:58:00 +0200
commitbc4409ab4ee3729f09151a4d7bdc6d95fdcaa3a1 (patch)
treec4b485a50df1e5ee8608d6d10599b250df65203d /sql/item_timefunc.h
parentf1ce69f3a9c01877c588c28eab9484fba8cd0e56 (diff)
downloadmariadb-git-bc4409ab4ee3729f09151a4d7bdc6d95fdcaa3a1.tar.gz
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.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h1
1 files changed, 1 insertions, 0 deletions
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)