1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

hang in dummy natural join (no common columns) Bug #4807

This commit is contained in:
serg@serg.mylan
2004-08-02 11:12:11 +02:00
parent e8d23cfa26
commit dec992d8fb
3 changed files with 41 additions and 22 deletions

View File

@ -2522,29 +2522,32 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
// to prevent natural join processing during PS re-execution
table->natural_join= 0;
if (!table->outer_join) // Not left join
if (cond_and->list.elements)
{
*conds= and_conds(*conds, cond_and);
// fix_fields() should be made with temporary memory pool
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
if (*conds && !(*conds)->fixed)
{
if ((*conds)->fix_fields(thd, tables, conds))
DBUG_RETURN(1);
}
}
else
{
table->on_expr= and_conds(table->on_expr, cond_and);
// fix_fields() should be made with temporary memory pool
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
if (table->on_expr && !table->on_expr->fixed)
{
if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
DBUG_RETURN(1);
}
if (!table->outer_join) // Not left join
{
*conds= and_conds(*conds, cond_and);
// fix_fields() should be made with temporary memory pool
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
if (*conds && !(*conds)->fixed)
{
if ((*conds)->fix_fields(thd, tables, conds))
DBUG_RETURN(1);
}
}
else
{
table->on_expr= and_conds(table->on_expr, cond_and);
// fix_fields() should be made with temporary memory pool
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
if (table->on_expr && !table->on_expr->fixed)
{
if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
DBUG_RETURN(1);
}
}
}
}
}