diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-08-02 10:48:55 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-08-02 10:48:55 +0400 |
commit | 1b87cd80a268d333acbf4fc4a3d7527cb5da3d4d (patch) | |
tree | 2ee914fd9aacb9e0c1ee60b7e22486b1a9cee98c /sql/item_timefunc.h | |
parent | 0c745c743c65ceb6533babdf21556b633e81566c (diff) | |
download | mariadb-git-1b87cd80a268d333acbf4fc4a3d7527cb5da3d4d.tar.gz |
MDEV-16878 Functions ADDTIME and SUBTIME get wrongly removed from WHERE by the equal expression optimizer
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 51ce3bf2988..7aacdec85e0 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -1245,8 +1245,10 @@ public: { sign= neg_arg ? -1 : 1; } bool fix_length_and_dec(); bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); - void print(String *str, enum_query_type query_type); - const char *func_name() const { return "add_time"; } + const char *func_name() const + { + return is_date ? "timestamp" : sign > 0 ? "addtime" : "subtime"; + } Item *get_copy(THD *thd) { return get_item_copy<Item_func_add_time>(thd, this); } }; |