summaryrefslogtreecommitdiff
path: root/sql/sql_time.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-18 16:46:57 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-18 16:46:57 +0200
commit5f6380adde2dac3f32b40339b9b702c0135eb7d6 (patch)
tree31068acc0b39c208d35d524688a5985831af0447 /sql/sql_time.cc
parent8a23ae088dc38f591efeab9eccdef5eb9094add9 (diff)
parent97e640b9ae83e07b444fceede6b0524256c7a3cc (diff)
downloadmariadb-git-5f6380adde2dac3f32b40339b9b702c0135eb7d6.tar.gz
10.0-base merge
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r--sql/sql_time.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index ff2ec62f815..a67768d4c34 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -330,7 +330,7 @@ str_to_datetime_with_warn(CHARSET_INFO *cs,
@param nr integer part of the number to convert
@param sec_part microsecond part of the number
@param ltime converted value will be written here
- @param fuzzydate conversion flags (TIME_FUZZY_DATE, etc)
+ @param fuzzydate conversion flags (TIME_INVALID_DATE, etc)
@param str original number, as an ErrConv. For the warning
@param field_name field name or NULL if not a field. For the warning
@@ -347,6 +347,7 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
if (fuzzydate & TIME_TIME_ONLY)
{
+ fuzzydate= TIME_TIME_ONLY; // clear other flags
f_type= MYSQL_TYPE_TIME;
res= number_to_time(neg, nr, sec_part, ltime, &was_cut);
}
@@ -356,7 +357,7 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
res= neg ? -1 : number_to_datetime(nr, sec_part, ltime, fuzzydate, &was_cut);
}
- if (res < 0 || (was_cut && !(fuzzydate & TIME_FUZZY_DATE)))
+ if (res < 0 || (was_cut && (fuzzydate & TIME_NO_ZERO_IN_DATE)))
{
make_truncated_value_warning(current_thd,
MYSQL_ERROR::WARN_LEVEL_WARN, str,