diff options
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 431674a58e2..d1df2b2aa71 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3101,7 +3101,8 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) /* fix to replace 'NULL' dates with '0' (shreeve@uci.edu) */ else if (((field->type() == FIELD_TYPE_DATE) || (field->type() == FIELD_TYPE_DATETIME)) && - (field->flags & NOT_NULL_FLAG)) + (field->flags & NOT_NULL_FLAG) && + !field->table->maybe_null) { COND *new_cond; if ((new_cond= new Item_func_eq(args[0],new Item_int("0", 0, 2)))) |