Commit 196862df authored by unknown's avatar unknown
Browse files

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

into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0


sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
parents 29a37a30 dc922213
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1296,7 +1296,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
    In case we're in statement prepare, create conversion item
    in its memory: it will be reused on each execute.
  */
  arena= thd->change_arena_if_needed(&backup);
  arena= thd->activate_stmt_arena_if_needed(&backup);

  for (arg= args, last= args + nargs; arg < last; arg++)
  {
@@ -1342,7 +1342,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
    conv->fix_fields(thd, arg);
  }
  if (arena)
    thd->restore_backup_item_arena(arena, &backup);
    thd->restore_active_arena(arena, &backup);
  return res;
}

@@ -1385,7 +1385,7 @@ Item_field::Item_field(THD *thd, Name_resolution_context *context_arg,
    structure can go away and pop up again between subsequent executions
    of a prepared statement).
  */
  if (thd->current_arena->is_stmt_prepare_or_first_sp_execute())
  if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
  {
    if (db_name)
      orig_db_name= thd->strdup(db_name);
+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
    If it is preparation PS only then we do not know values of parameters =>
    cant't get there values and do not need that values.
  */
  if (!thd->current_arena->is_stmt_prepare())
  if (!thd->stmt_arena->is_stmt_prepare())
    cache->store(args[0]);
  if (cache->cols() == 1)
  {
+2 −2
Original line number Diff line number Diff line
@@ -1875,7 +1875,7 @@ bool Item_func_rand::fix_fields(THD *thd,Item **ref)
  if (arg_count)
  {					// Only use argument once in query
    /*
      Allocate rand structure once: we must use thd->current_arena
      Allocate rand structure once: we must use thd->stmt_arena
      to create rand in proper mem_root if it's a prepared statement or
      stored procedure.

@@ -1883,7 +1883,7 @@ bool Item_func_rand::fix_fields(THD *thd,Item **ref)
      as it will be replicated in the query as such.
    */
    if (!rand && !(rand= (struct rand_struct*)
                   thd->current_arena->alloc(sizeof(*rand))))
                   thd->stmt_arena->alloc(sizeof(*rand))))
      return TRUE;
    /*
      PARAM_ITEM is returned if we're in statement prepare and consequently
+6 −6
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
    return RES_OK;

  SELECT_LEX *select_lex= join->select_lex;
  Query_arena *arena= thd->current_arena;
  Query_arena *arena= thd->stmt_arena;
 
  if (!select_lex->master_unit()->first_select()->next_select() &&
      !select_lex->table_list.elements &&
@@ -1287,10 +1287,10 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
  */
  if (!optimizer)
  {
    arena= thd->change_arena_if_needed(&backup);
    arena= thd->activate_stmt_arena_if_needed(&backup);
    result= (!(optimizer= new Item_in_optimizer(left_expr, this)));
    if (arena)
      thd->restore_backup_item_arena(arena, &backup);
      thd->restore_active_arena(arena, &backup);
    if (result)
      goto err;
  }
@@ -1306,7 +1306,7 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
    goto err;

  transformed= 1;
  arena= thd->change_arena_if_needed(&backup);
  arena= thd->activate_stmt_arena_if_needed(&backup);
  /*
    Both transformers call fix_fields() only for Items created inside them,
    and all that items do not make permanent changes in current item arena
@@ -1322,14 +1322,14 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
    if (func != &eq_creator)
    {
      if (arena)
        thd->restore_backup_item_arena(arena, &backup);
        thd->restore_active_arena(arena, &backup);
      my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
      DBUG_RETURN(RES_ERROR);
    }
    res= row_value_transformer(join);
  }
  if (arena)
    thd->restore_backup_item_arena(arena, &backup);
    thd->restore_active_arena(arena, &backup);
err:
  thd->where= save_where;
  DBUG_RETURN(res);
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ class JOIN;
class select_subselect;
class subselect_engine;
class Item_bool_func2;
class Item_arena;

/* base class for subselects */

Loading