-
unknown authored
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. sql/field.cc: Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used. The Field::make_field function now resets the table_name and the org_col_name variables when the orig_table is set to 0. sql/sql_select.cc: Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used. 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. tests/mysql_client_test.c: The test case for the bug#21635 is altered to test behavior on both const and non-const tables.
6a8bd84a