Merge from 5.3

modified:
  mysql-test/r/type_date.result
  mysql-test/r/type_datetime.result
  mysql-test/r/type_time.result
  mysql-test/t/type_date.test
  mysql-test/t/type_datetime.test
  mysql-test/t/type_time.test
  sql/item_func.cc
  sql/item_timefunc.cc
  sql/sql_time.cc
  sql/sql_time.h
pending merges:
  Alexander Barkov 2013-06-28 MDEV-4634 Crash in CONVERT_TZ
This commit is contained in:
Alexander Barkov 2013-06-28 15:20:40 +04:00
commit f13236be86
10 changed files with 80 additions and 10 deletions

View file

@ -41,6 +41,7 @@
#include "sql_acl.h" // EXECUTE_ACL
#include "mysqld.h" // LOCK_short_uuid_generator
#include "rpl_mi.h"
#include "sql_time.h"
#include <m_ctype.h>
#include <hash.h>
#include <time.h>
@ -2779,6 +2780,12 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
min_max= res;
}
unpack_time(min_max, ltime);
if (!(fuzzy_date & TIME_TIME_ONLY) &&
((null_value= check_date_with_warn(ltime, fuzzy_date,
MYSQL_TIMESTAMP_ERROR))))
return true;
if (compare_as_dates->field_type() == MYSQL_TYPE_DATE)
{
ltime->time_type= MYSQL_TIMESTAMP_DATE;