mirror of
https://github.com/MariaDB/server.git
synced 2025-10-12 12:25:37 +03:00
Fixed bug mdev-4962.
When a non-nullable datetime field is used under an IS NULL predicate of the WHERE condition in a query with outer joins the remove_eq_conds function should check whether this field belongs to an inner table of any outer join that can be, in a general case, a nested outer join.
This commit is contained in:
@@ -13564,7 +13564,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
|
||||
if (!(eq_cond= new Item_func_eq(args[0],new Item_int("0", 0, 2))))
|
||||
return cond;
|
||||
|
||||
if (field->table->pos_in_table_list->outer_join)
|
||||
if (field->table->pos_in_table_list->is_inner_table_of_outer_join())
|
||||
{
|
||||
// outer join: transform "col IS NULL" to "col IS NULL or col=0"
|
||||
Item *or_cond= new Item_cond_or(eq_cond, cond);
|
||||
|
Reference in New Issue
Block a user