From 37f18d2318c966b84a5e91a31c0985a9b2d0d9fd Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 29 Aug 2013 10:56:12 -0700 Subject: 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. --- sql/table.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/table.h') diff --git a/sql/table.h b/sql/table.h index d66a6a44753..49b9fe2a1b9 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1845,6 +1845,16 @@ struct TABLE_LIST bool single_table_updatable(); + bool is_inner_table_of_outer_join() + { + for (TABLE_LIST *tbl= this; tbl; tbl= tbl->embedding) + { + if (tbl->outer_join) + return true; + } + return false; + } + private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause); -- cgit v1.2.1