summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-12-14 18:14:21 +0300
committerAleksey Midenkov <midenok@gmail.com>2017-12-14 18:14:21 +0300
commit1668efb722d6d2fb483745d23915378167937d1d (patch)
treea2cc6994a50055784976b5069e8e6b6f23dd4f51 /sql/item_timefunc.cc
parent765569602d4211a5daa0f175faa78a4922819bc4 (diff)
downloadmariadb-git-1668efb722d6d2fb483745d23915378167937d1d.tar.gz
MDEV-14645: AS OF TIMESTAMP is misused as TRX_ID [fixes #396]
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index fd170a707c9..4563f4555f5 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2652,6 +2652,26 @@ bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
}
+void Item_datetime_from_unixtime_typecast::fix_length_and_dec()
+{
+ Item_datetime_typecast::fix_length_and_dec();
+
+ switch (args[0]->result_type())
+ {
+ case INT_RESULT:
+ case REAL_RESULT:
+ case DECIMAL_RESULT:
+ {
+ Item_func_from_unixtime *a= new (thd->mem_root) Item_func_from_unixtime(thd, args[0]);
+ a->fix_length_and_dec();
+ args[0]= a;
+ break;
+ }
+ default:;
+ }
+}
+
+
/**
MAKEDATE(a,b) is a date function that creates a date value
from a year and day value.