• Igor Babaev's avatar
    Fixed LP bug #777745. · 016a09cb
    Igor Babaev authored
    Fields belonging to views in general cannot be substituted for 
    equal items, in particular for constants, because all references
    to a view field refer to the same Item_field object while they 
    could be used in different OR parts of the where condition and
    belong to different equivalence classes (to different Item_equals).
    That's why substitution for equal items in any context is allowed
    only in place of Item_direct_view_ref objects, but not in place of
    Item_fields these objects refer to.
    Due to some erroneous code in the patch for bug 717577 substitution
    for view fields were allowed in some context.This could lead
    to wrong results returned by queries using views.
    
    The fix prohibits substitution of view fields for equal items 
    in any context.
    
    The patch also changes slightly the compile method for the Item_func
    class. Now if the analyze method returns NULL in his parameter the
    compile method is not called for the arguments of the function
    at all. A similar change was made for the Item_ref class.     
    016a09cb
item_cmpfunc.h 57.1 KB