• evgen@moonbone.local's avatar
    Fixed bug#16861: User defined variable can have a wrong value if a tmp table was · e098f736
    evgen@moonbone.local authored
    used.
    
    The Item::save_in_field() function is called from fill_record() to fill the 
    new row with data while execution of the CREATE TABLE ... SELECT statement.
    Item::save_in_field() calls val_xxx() methods in order to get values.
    val_xxx() methods do not take into account the result field. Due to this
    Item_func_set_user_var::val_xxx() methods returns values from the original
    table, not from the temporary one.
    
    The save_in_field() member function is added to the Item_func_set_user_var
    class. It detects whether the result field should be used and properly updates
    the value of the user variable.
    e098f736
user_var.test 6.34 KB