summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-07-02 22:11:12 +0300
committerMichael Widenius <monty@askmonty.org>2013-07-02 22:11:12 +0300
commit82a0b8ae30bc7c9ad9b27bf00ec608954f2262e0 (patch)
tree519597ce7da4038e1fc6f68908c272b0946030b0 /sql
parent99aae21ed25b42ee3cf62815ecfc8204de8b6fd0 (diff)
downloadmariadb-git-82a0b8ae30bc7c9ad9b27bf00ec608954f2262e0.tar.gz
strict.test now works.
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item_timefunc.cc6
-rw-r--r--sql/sql_class.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 035f017464c..f004f25b18c 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -297,7 +297,7 @@ String *Item::val_string_from_decimal(String *str)
String *Item::val_string_from_date(String *str)
{
MYSQL_TIME ltime;
- if (get_date(&ltime, TIME_FUZZY_DATE) ||
+ if (get_date(&ltime, TIME_FUZZY_DATE | sql_mode_for_dates()) ||
str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
@@ -354,7 +354,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
- if (get_date(&ltime, TIME_FUZZY_DATE))
+ if (get_date(&ltime, TIME_FUZZY_DATE | sql_mode_for_dates()))
{
my_decimal_set_zero(decimal_value);
null_value= 1; // set NULL, stop processing
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 117904d8b82..8177a019386 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -415,8 +415,10 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
l_time->minute > 59 || l_time->second > 59)
goto err;
- if ((fuzzy_date & TIME_NO_ZERO_DATE) &&
- (l_time->year == 0 || l_time->month == 0 || l_time->day == 0))
+ if (((fuzzy_date & TIME_NO_ZERO_IN_DATE) &&
+ (l_time->year == 0 || l_time->month == 0 || l_time->day == 0)) ||
+ (fuzzy_date & TIME_NO_ZERO_DATE) &&
+ (l_time->year == 0 && l_time->month == 0 && l_time->day == 0))
goto err;
if (val != val_end)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e8e3c9da515..48799a62bb2 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3417,7 +3417,7 @@ my_eof(THD *thd)
checking for all date handling.
*/
-const my_bool strict_date_checking= 0;
+const my_bool strict_date_checking= 1;
inline sql_mode_t sql_mode_for_dates(THD *thd)
{