• unknown's avatar
    Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong · 593bed0d
    unknown authored
    select result
    
    Item equal objects are employed only at the optimize phase. Usually they are not
    supposed to be evaluated.  Yet in some cases we call the method val_int() for
    them. Here we have to take care of restricting the predicate such an object
    represents f1=f2= ...=fn to the projection of known fields fi1=...=fik.
    
    Added a check for field's table being const in Item_equal::val_int().
    If the field's table is not const val_int() just skips that field when
    evaluating Item_equal.
    
    
    mysql-test/t/select.test:
      Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result
    mysql-test/r/select.result:
      Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result
    mysql-test/r/func_group.result:
      Corrected test result for bug #12882 after fix for bug#15633
    sql/item_cmpfunc.h:
      Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result
      Added comment about fields from non-const tables in class description.
    sql/item_cmpfunc.cc:
      Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result
      Added check for field's table being const in Item_equal::val_int().
    593bed0d
item_cmpfunc.h 38.3 KB