• Sergey Glukhov's avatar
    Bug#11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION · 7fa7a0ca
    Sergey Glukhov authored
    When we create temporary result table for UNION
    incorrect max_length for YEAR field is used and
    it leads to incorrect field value and incorrect
    result string length as YEAR field value calculation
    depends on field length.
    The fix is to use underlying item max_length for
    Item_sum_hybrid::max_length intialization.
    
    
    mysql-test/r/func_group.result:
      test case
    mysql-test/t/func_group.test:
      test case
    sql/field.cc:
      added assert
    sql/item_sum.cc:
      init Item_sum_hybrid::max_length with 
      use underlying item max_length for
      INT result type.
    7fa7a0ca
field.cc 289 KB