• Alexander Barkov's avatar
    MDEV-23337 Rounding functions create a wrong data type for integer input · a874b6c4
    Alexander Barkov authored
    1. Fixing ROUND(x) and TRUNCATE(x,0) with TINYINT, SMALLINT, MEDIUMINT, BIGINT
       input to preserve the exact data type of the argument when it's possible.
    
    2. Fixing FLOOR(x) and CEILING(x) with TINYINT, SMALLINT, MEDIUMINT, BIGINT
      to preserve the exact data type of the argument.
    
    3. Adding dedicated Type_handler_year::Item_func_round_fix_length_and_dec()
      to easier handle ROUND(x) and TRUNCATE(x,y) for the YEAR(2) and YEAR(4)
      input. They still return INT(2) UNSIGNED and INT(4) UNSIGNED correspondingly,
      as before.
    a874b6c4
item_func.cc 181 KB