• Alexander Barkov's avatar
    MDEV-21977 main.func_math fails due to undefined behaviour · 328edf85
    Alexander Barkov authored
    The problem happened in these line:
    
    uval0= (ulonglong) (val0_negative ? -val0 : val0);
    uval1= (ulonglong) (val1_negative ? -val1 : val1);
    
    return check_integer_overflow(val0_negative ? -(longlong) res : res,
                                  !val0_negative);
    
    when unary minus was performed on -9223372036854775808.
    This behavior is undefined in C/C++.
    328edf85
func_math.test 21.1 KB