mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc
This commit is contained in:
24
sql/table.cc
24
sql/table.cc
@ -3390,7 +3390,7 @@ TABLE_LIST *TABLE_LIST::find_underlying_table(TABLE *table_to_find)
|
||||
}
|
||||
|
||||
/*
|
||||
cleunup items belonged to view fields translation table
|
||||
cleanup items belonged to view fields translation table
|
||||
|
||||
SYNOPSIS
|
||||
TABLE_LIST::cleanup_items()
|
||||
@ -3836,10 +3836,10 @@ Natural_join_column::Natural_join_column(Field_translator *field_param,
|
||||
}
|
||||
|
||||
|
||||
Natural_join_column::Natural_join_column(Field *field_param,
|
||||
Natural_join_column::Natural_join_column(Item_field *field_param,
|
||||
TABLE_LIST *tab)
|
||||
{
|
||||
DBUG_ASSERT(tab->table == field_param->table);
|
||||
DBUG_ASSERT(tab->table == field_param->field->table);
|
||||
table_field= field_param;
|
||||
view_field= NULL;
|
||||
table_ref= tab;
|
||||
@ -3867,7 +3867,7 @@ Item *Natural_join_column::create_item(THD *thd)
|
||||
return create_view_field(thd, table_ref, &view_field->item,
|
||||
view_field->name);
|
||||
}
|
||||
return new Item_field(thd, &thd->lex->current_select->context, table_field);
|
||||
return table_field;
|
||||
}
|
||||
|
||||
|
||||
@ -3878,7 +3878,7 @@ Field *Natural_join_column::field()
|
||||
DBUG_ASSERT(table_field == NULL);
|
||||
return NULL;
|
||||
}
|
||||
return table_field;
|
||||
return table_field->field;
|
||||
}
|
||||
|
||||
|
||||
@ -4010,7 +4010,7 @@ void Field_iterator_natural_join::next()
|
||||
cur_column_ref= column_ref_it++;
|
||||
DBUG_ASSERT(!cur_column_ref || ! cur_column_ref->table_field ||
|
||||
cur_column_ref->table_ref->table ==
|
||||
cur_column_ref->table_field->table);
|
||||
cur_column_ref->table_field->field->table);
|
||||
}
|
||||
|
||||
|
||||
@ -4174,7 +4174,7 @@ GRANT_INFO *Field_iterator_table_ref::grant()
|
||||
*/
|
||||
|
||||
Natural_join_column *
|
||||
Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
|
||||
Field_iterator_table_ref::get_or_create_column_ref(THD *thd, TABLE_LIST *parent_table_ref)
|
||||
{
|
||||
Natural_join_column *nj_col;
|
||||
bool is_created= TRUE;
|
||||
@ -4187,7 +4187,11 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
|
||||
{
|
||||
/* The field belongs to a stored table. */
|
||||
Field *tmp_field= table_field_it.field();
|
||||
nj_col= new Natural_join_column(tmp_field, table_ref);
|
||||
Item_field *tmp_item=
|
||||
new Item_field(thd, &thd->lex->current_select->context, tmp_field);
|
||||
if (!tmp_item)
|
||||
return NULL;
|
||||
nj_col= new Natural_join_column(tmp_item, table_ref);
|
||||
field_count= table_ref->table->s->fields;
|
||||
}
|
||||
else if (field_it == &view_field_it)
|
||||
@ -4211,7 +4215,7 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
|
||||
DBUG_ASSERT(nj_col);
|
||||
}
|
||||
DBUG_ASSERT(!nj_col->table_field ||
|
||||
nj_col->table_ref->table == nj_col->table_field->table);
|
||||
nj_col->table_ref->table == nj_col->table_field->field->table);
|
||||
|
||||
/*
|
||||
If the natural join column was just created add it to the list of
|
||||
@ -4276,7 +4280,7 @@ Field_iterator_table_ref::get_natural_column_ref()
|
||||
nj_col= natural_join_it.column_ref();
|
||||
DBUG_ASSERT(nj_col &&
|
||||
(!nj_col->table_field ||
|
||||
nj_col->table_ref->table == nj_col->table_field->table));
|
||||
nj_col->table_ref->table == nj_col->table_field->field->table));
|
||||
return nj_col;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user