• unknown's avatar
    Fixed bug #29417. · 578d9721
    unknown authored
    An assertion abort could occur for some grouping queries that employed 
    decimal user variables with assignments to them.
    
    The problem appeared the constructors of the class Field_new_decimal
    because the function my_decimal_length_to_precision did not guarantee
    returning decimal precision not greater than DECIMAL_MAX_PRECISION.
    
    
    mysql-test/r/type_newdecimal.result:
      Added a test case for bug #29417.
    mysql-test/t/type_newdecimal.test:
      Added a test case for bug #29417.
    sql/field.cc:
      Fixed bug #29417.
      An assertion abort could occur for some grouping queries that employed 
      decimal user variables with assignments to them.
      
      The problem appeared the constructors of the class Field_new_decimal
      because the function my_decimal_length_to_precision did not guarantee
      returning decimal precision not greater than DECIMAL_MAX_PRECISION.
      
      Now if the precision returned by calls to my_decimal_length_to_precision
      in the constructors of the class Field_new_decimal is greater than 
      DECIMAL_MAX_PRECISION the precision is set to this value.
    578d9721
field.cc 249 KB