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

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-on-4.1


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/table.h:
  Auto merged
This commit is contained in:
unknown
2004-04-03 11:28:20 +03:00
12 changed files with 172 additions and 78 deletions

View File

@ -2405,15 +2405,13 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
if (table->on_expr)
{
if (stmt)
thd->set_n_backup_item_arena(stmt, &backup);
/* Make a join an a expression */
thd->where="on clause";
if (!table->on_expr->fixed &&
table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
table->on_expr->check_cols(1))
goto err;
DBUG_RETURN(1);
thd->lex->current_select->cond_count++;
/*
@ -2425,12 +2423,16 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
!(specialflag & SPECIAL_NO_NEW_FUNC)))
{
table->outer_join= 0;
if (!(*conds= and_conds(thd, *conds, table->on_expr, tables)))
goto err;
if (stmt)
thd->set_n_backup_item_arena(stmt, &backup);
*conds= and_conds(*conds, table->on_expr);
table->on_expr=0;
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
if ((*conds) && !(*conds)->fixed &&
(*conds)->fix_fields(thd, tables, conds))
DBUG_RETURN(1);
}
if (stmt)
thd->restore_backup_item_arena(stmt, &backup);
}
if (table->natural_join)
{
@ -2469,20 +2471,28 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
if (!table->outer_join) // Not left join
{
if (!(*conds= and_conds(thd, *conds, cond_and, tables)) ||
(*conds && !(*conds)->fixed &&
(*conds)->fix_fields(thd, tables, conds)))
goto err;
*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(thd, table->on_expr, cond_and, tables);
if (table->on_expr && !table->on_expr->fixed &&
table->on_expr->fix_fields(thd, tables, &table->on_expr))
goto err;
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 (stmt)
thd->restore_backup_item_arena(stmt, &backup);
}
}