In make_join_select():

- move attempt to evaluate join->exec_const_cond() out of the "Extract constant part of each ON expression" loop
  (it got there by mistake when merging).
This commit is contained in:
Sergey Petrunya 2011-06-12 00:35:53 +04:00
parent 9f6f04360a
commit 0f22ba3cfe

View file

@ -7726,6 +7726,14 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
DBUG_EXECUTE("where",print_where(join->exec_const_cond,"constants",
QT_ORDINARY););
if (join->exec_const_cond && !join->exec_const_cond->is_expensive() &&
!join->exec_const_cond->val_int())
{
DBUG_PRINT("info",("Found impossible WHERE condition"));
join->exec_const_cond= NULL;
DBUG_RETURN(1); // Impossible const condition
}
uint linear_no= join->const_tables;
for (JOIN_TAB *tab= first_linear_tab(join, WITHOUT_CONST_TABLES);
tab;
@ -7754,14 +7762,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
}
if (join->exec_const_cond && !join->exec_const_cond->is_expensive() &&
!join->exec_const_cond->val_int())
{
DBUG_PRINT("info",("Found impossible WHERE condition"));
join->exec_const_cond= NULL;
DBUG_RETURN(1); // Impossible const condition
}
COND *outer_ref_cond= make_cond_for_table(thd, cond,
OUTER_REF_TABLE_BIT,
OUTER_REF_TABLE_BIT,