summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-06 18:23:40 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-06 18:23:40 +0400
commite30b6a983fe135dd1af0c79c81dbdb5b14b881c8 (patch)
tree284cb101a0da934fa5c742248a8dfffba2d965f3 /sql/item_timefunc.h
parentbea99275de3871ea286ab935d4d9d6fe26dd45b8 (diff)
downloadmariadb-git-e30b6a983fe135dd1af0c79c81dbdb5b14b881c8.tar.gz
MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 0062d500835..5be9c5cacbd 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -500,8 +500,16 @@ public:
{ return val_decimal_from_date(decimal_value); }
Field *tmp_table_field(TABLE *table)
{ return tmp_table_field_from_field_type(table, 0); }
+#if MARIADB_VERSION_ID > 100300
+#error This code should be removed in 10.3, to use the derived save_in_field()
+#else
int save_in_field(Field *field, bool no_conversions)
- { return save_date_in_field(field); }
+ {
+ return field_type() == MYSQL_TYPE_TIME ?
+ save_time_in_field(field) :
+ save_date_in_field(field);
+ }
+#endif
void fix_length_and_dec();
};