mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
Fixed bug mdev-4418.
After single row substitutions there might appear new equalities. They should be properly propagated to all AND/OR levels the WHERE condition. It's done now with an additional call of remove_eq_conds().
This commit is contained in:
@@ -1210,6 +1210,23 @@ JOIN::optimize()
|
||||
/* Handle the case where we have an OUTER JOIN without a WHERE */
|
||||
conds=new Item_int((longlong) 1,1); // Always true
|
||||
}
|
||||
|
||||
if (const_tables && conds)
|
||||
{
|
||||
conds= remove_eq_conds(thd, conds, &cond_value);
|
||||
if (cond_value == Item::COND_FALSE)
|
||||
{
|
||||
zero_result_cause=
|
||||
"Impossible WHERE noticed after reading const tables";
|
||||
select_lex->mark_const_derived(zero_result_cause);
|
||||
if (select_options & SELECT_DESCRIBE)
|
||||
{
|
||||
conds=new Item_int((longlong) 0,1);
|
||||
}
|
||||
goto setup_subq_exit;
|
||||
}
|
||||
}
|
||||
|
||||
select= make_select(*table, const_table_map,
|
||||
const_table_map, conds, 1, &error);
|
||||
if (error)
|
||||
|
Reference in New Issue
Block a user