diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index eebcd89..4a03973 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3193,8 +3193,10 @@ bool Item_func_between::resolve_type(THD *thd) { if (cvt_arg1 && cvt_arg2) cmp_type = INT_RESULT; } - if (args[0]->is_temporal() && args[1]->is_temporal() && - args[2]->is_temporal() && args[0]->data_type() != MYSQL_TYPE_YEAR && + if (args[0]->is_temporal() && + (args[1]->is_temporal() || args[1]->is_null()) && + (args[2]->is_temporal() || args[2]->is_null()) && + args[0]->data_type() != MYSQL_TYPE_YEAR && args[1]->data_type() != MYSQL_TYPE_YEAR && args[2]->data_type() != MYSQL_TYPE_YEAR) { /*