Bug#38291 memory corruption and server crash with view/sp/function

Send_field.org_col_name has broken value on secondary execution.
It happens when result field is created from the field which belongs to view
due to forgotten assignment of some Send_field attributes. 
The fix:
set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.

mysql-test/r/metadata.result:
  result fix
  The result file was changed because now forgotten attributes are properly set.
mysql-test/r/sp.result:
  test result
mysql-test/t/sp.test:
  test case
sql/item.cc:
  Send_field.org_col_name has broken value on secondary execution.
  It happens when result field is created from the field which belongs to view
  due to forgotten assignment of some Send_field attributes. 
  The fix:
  set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
tests/mysql_client_test.c:
  test case fix
  The test was changed because now forgotten attributes are properly set.
This commit is contained in:
Sergey Glukhov 2008-08-20 14:49:28 +05:00
commit de73b72954
5 changed files with 51 additions and 7 deletions

View file

@ -5764,6 +5764,10 @@ void Item_ref::make_field(Send_field *field)
field->table_name= table_name;
if (db_name)
field->db_name= db_name;
if (orig_field_name)
field->org_col_name= orig_field_name;
if (orig_table_name)
field->org_table_name= orig_table_name;
}