1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used.

The change_to_use_tmp_fields function leaves the orig_table member of an
expression's tmp table field filled for the new Item_field being created.
Later orig_table is used by the Field::make_field function to provide some
info about original table and field name to a user. This is ok for a field
but for an expression it should be empty.

The change_to_use_tmp_fields function now resets orig_table member of
an expression's tmp table field to prevent providing a wrong info to a user.
The Field::make_field function now resets the table_name and the org_col_name
variables when the orig_table is set to 0.
This commit is contained in:
evgen@moonbone.local
2007-09-28 23:24:40 +00:00
parent fca2a0c4ac
commit b9e81c2ae3
5 changed files with 117 additions and 24 deletions

View File

@ -14119,6 +14119,9 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
item_field= (Item*) new Item_field(field);
if (!item_field)
DBUG_RETURN(TRUE); // Fatal error
if (item->real_item()->type() != Item::FIELD_ITEM)
field->orig_table= 0;
item_field->name= item->name;
#ifndef DBUG_OFF
if (_db_on_ && !item_field->name)