• unknown's avatar
    Bug #30587: mysql crashes when trying to group by TIME div NUMBER · bebcb221
    unknown authored
    When calculating the result length of an integer DIV function 
    the number of decimals was used without checking the result type
    first. Thus an uninitialized number of decimals was used for some 
    types. This caused an excessive amount of memory to be allocated 
    for the field's buffer and crashed the server.
    
     
    Fixed by using the number of decimals only for data types that 
    can have decimals and thus have valid decimals number.
    
    
    mysql-test/r/func_math.result:
      Bug #30587: test case
    mysql-test/t/func_math.test:
      Bug #30587: test case
    sql/item_func.cc:
      Bug #30587: Don't use decimals on a type that doesn't have them.
    bebcb221
func_math.result 15.3 KB