diff options
author | tnurnberg@mysql.com/white.intern.koehntopp.de <> | 2007-12-11 10:12:05 +0100 |
---|---|---|
committer | tnurnberg@mysql.com/white.intern.koehntopp.de <> | 2007-12-11 10:12:05 +0100 |
commit | 3f0f275030246c333b38c48c8b8be204e95c4f38 (patch) | |
tree | fedb6851ea468b3096b7c68285811f5fb96c0141 /sql/field.h | |
parent | b1e77cfc31738cf8480d8acf498c46535dee68b9 (diff) | |
download | mariadb-git-3f0f275030246c333b38c48c8b8be204e95c4f38.tar.gz |
Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE
HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast.
This happened because DATE-cast object did not overload get_time() method
in superclass Item. The default method was inappropriate here and
misinterpreted the data.
Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL
on NULL input, 0 otherwise. This coincides with the way DATE-columns
behave.
Also fixes similar bug in Date-Field now.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index 8c01931fa21..8ae39f78558 100644 --- a/sql/field.h +++ b/sql/field.h @@ -933,6 +933,7 @@ public: double val_real(void); longlong val_int(void); String *val_str(String*,String *); + bool get_time(MYSQL_TIME *ltime); bool send_binary(Protocol *protocol); int cmp(const char *,const char*); void sort_string(char *buff,uint length); |