Commit 0f22ba3c authored by Sergey Petrunya's avatar Sergey Petrunya

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).
parent 9f6f0436
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment