summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-07-30 14:30:21 +0400
committerAlexander Barkov <bar@mariadb.com>2020-07-31 07:41:30 +0400
commita874b6c4459a2dd028d6c4a15e43eeb556183de0 (patch)
tree8bdf3954c5be21423cb11bde76823de9b27e9aad /sql/item_func.h
parentc3958ae407016d7dde8b04ffbacf949c62b2e4eb (diff)
downloadmariadb-git-a874b6c4459a2dd028d6c4a15e43eeb556183de0.tar.gz
MDEV-23337 Rounding functions create a wrong data type for integer input
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.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index d1ebf98ccda..549e576dbd3 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1774,7 +1774,7 @@ public:
return NULL;
}
void fix_arg_decimal();
- void fix_arg_int();
+ void fix_arg_int(const Type_handler *preferred);
void fix_arg_double();
void fix_arg_time();
void fix_arg_datetime();