• Sergei Golubchik's avatar
    a simpler fix for · 027e34e1
    Sergei Golubchik authored
    MySQL Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT SAME USER VARIABLE = CRASH
    and
    MySQL Bug#14664077 SEVERE PERFORMANCE DEGRADATION IN SOME CASES WHEN USER VARIABLES ARE USED
    
    
    sql/item_func.cc:
      don't use anything from Item_func_set_user_var::fix_fields()
      in Item_func_set_user_var::save_item_result()
    sql/sql_class.cc:
      Call suv->save_item_result(item) *before* doing suv->fix_fields(), because
      the former evaluates the item (and caches its value), while the latter marks
      the user variable as non-const. The problem is that the item was fix_field'ed
      when the user variable was const, and it doesn't expect it to change to non-const
      in the middle of the execution.
    027e34e1
sql_class.cc 114 KB