Commit 679088a2 authored by unknown's avatar unknown

Fix for Bug#8801: the bug was in co-operation of Item_ref

with view-merge algorithm and prepared statements: in case when some
Item_ref pointing to a view column was substituted with a reference 
pointing to the view expression for that column
Item_ref::ref member of the original Item_ref was left pointing to 
not_found_item (0x1).
As we currently perform expression substition part of the view-merge 
algorithm per each execution of a prepared statement or stored procedure, 
we need to preserve original Item_ref objects usable.


sql/item.cc:
  Set member Item_ref::ref to null whenever the item itself is substituted 
  with another item.
  This is necessary if we want to re-execute a prepared statement next time.
  
  Additionally Item_ref::fix_fields() implementation was cleaned up
  (by Monty and myself) to reduce the number of if branches. This
  doesn't change the logic of this function.
parent ad1c1e07
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment