mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge gleb.loc:/home/uchum/work/bk/mysql-5.0-opt
into gleb.loc:/home/uchum/work/bk/mysql-5.1-opt client/mysqldump.c: Auto merged mysql-test/r/join_outer.result: Auto merged mysql-test/r/kill.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/join_outer.test: Auto merged mysql-test/t/kill.test: Auto merged sql/field.h: Auto merged sql/item_func.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged mysql-test/r/mysqldump.result: Merge with 5.0-opt mysql-test/t/mysqldump.test: Merge with 5.0-opt mysql-test/t/view.test: Merge with 5.0-opt sql/sql_select.cc: Merge with 5.0-opt
This commit is contained in:
@ -6099,13 +6099,39 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
|
||||
}
|
||||
|
||||
/*
|
||||
Push down all predicates from on expressions.
|
||||
Each of these predicated are guarded by a variable
|
||||
Push down conditions from all on expressions.
|
||||
Each of these conditions are guarded by a variable
|
||||
that turns if off just before null complemented row for
|
||||
outer joins is formed. Thus, the predicates from an
|
||||
outer joins is formed. Thus, the condition from an
|
||||
'on expression' are guaranteed not to be checked for
|
||||
the null complemented row.
|
||||
*/
|
||||
|
||||
/* First push down constant conditions from on expressions */
|
||||
for (JOIN_TAB *join_tab= join->join_tab+join->const_tables;
|
||||
join_tab < join->join_tab+join->tables ; join_tab++)
|
||||
{
|
||||
if (*join_tab->on_expr_ref)
|
||||
{
|
||||
JOIN_TAB *cond_tab= join_tab->first_inner;
|
||||
COND *tmp= make_cond_for_table(*join_tab->on_expr_ref,
|
||||
join->const_table_map,
|
||||
(table_map) 0);
|
||||
if (!tmp)
|
||||
continue;
|
||||
tmp= new Item_func_trig_cond(tmp, &cond_tab->not_null_compl);
|
||||
if (!tmp)
|
||||
DBUG_RETURN(1);
|
||||
tmp->quick_fix_field();
|
||||
cond_tab->select_cond= !cond_tab->select_cond ? tmp :
|
||||
new Item_cond_and(cond_tab->select_cond,tmp);
|
||||
if (!cond_tab->select_cond)
|
||||
DBUG_RETURN(1);
|
||||
cond_tab->select_cond->quick_fix_field();
|
||||
}
|
||||
}
|
||||
|
||||
/* Push down non-constant conditions from on expressions */
|
||||
JOIN_TAB *last_tab= tab;
|
||||
while (first_inner_tab && first_inner_tab->last_inner == last_tab)
|
||||
{
|
||||
@ -6558,7 +6584,6 @@ void JOIN::cleanup(bool full)
|
||||
for (tab= join_tab, end= tab+tables; tab != end; tab++)
|
||||
tab->cleanup();
|
||||
table= 0;
|
||||
tables= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user