summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 54b78cdf51c..0a177a58dbd 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -366,7 +366,8 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
old_read_map= dbug_tmp_use_all_columns(table, table->read_set);
}
/* For comparison purposes allow invalid dates like 2000-01-32 */
- thd->variables.sql_mode|= MODE_INVALID_DATES;
+ thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
+ MODE_INVALID_DATES;
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
if (!(*item)->save_in_field(field, 1) && !((*item)->null_value))
{