• Sergey Glukhov's avatar
    Bug#57477 SIGFPE when dividing a huge number a negative number · 378f0378
    Sergey Glukhov authored
    The problem is dividing by const value when
    the result is out of supported range.
    The fix:
    -return LONGLONG_MIN if the result is out of supported range for DIV operator.
    -return 0 if divisor is -1 for MOD operator.
    
    
    mysql-test/r/func_math.result:
      test case
    mysql-test/t/func_math.test:
      test case
    sql/item_func.cc:
      -return LONGLONG_MIN if the result is out of supported range for DIV operator.
      -return 0 if divisor is -1 for MOD operator.
    378f0378
func_math.result 18 KB