summaryrefslogtreecommitdiff
path: root/sql/sql_time.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2013-07-08 16:49:42 +0400
committerAlexander Barkov <bar@mariadb.org>2013-07-08 16:49:42 +0400
commit1f3ec9800c6c186949302ba27f0137dfe7c0f5f5 (patch)
treee0e46189e0c73712d39954f0280c63830fd5332e /sql/sql_time.cc
parent874bb251372d60243d44e2ba74f0237bc88ec8c2 (diff)
parent78cc6db44a9f1344dd5c00cf4f3cdde158fe108e (diff)
downloadmariadb-git-1f3ec9800c6c186949302ba27f0137dfe7c0f5f5.tar.gz
Merging from 5.3
modified: include/my_time.h libmysql/libmysql.c mysql-test/r/adddate_454.result mysql-test/r/cast.result mysql-test/r/date_formats.result mysql-test/r/func_sapdb.result mysql-test/r/func_time.result mysql-test/r/mdev316.result mysql-test/r/parser.result mysql-test/r/partition_datatype.result mysql-test/r/partition_pruning.result mysql-test/r/type_date.result mysql-test/r/type_datetime.result mysql-test/suite/vcol/r/vcol_misc.result mysql-test/t/cast.test sql-common/my_time.c sql/field.cc sql/field_conv.cc sql/filesort.cc sql/item.cc sql/item.h sql/item_cmpfunc.cc sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/sql_time.cc pending merges: Sergei Golubchik 2013-07-03 MDEV-4667 DATE('string') incompability betwe...
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 82e8898657d..dab8a907678 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -332,7 +332,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
@@ -349,6 +349,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);
}
@@ -358,7 +359,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,