summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-14 11:57:47 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-14 11:57:47 +0400
commit4dc690dc28d69abcc2be683819d8ab0798df0c9e (patch)
treec1ad9b3302f40092983769d33608c064c1449566 /sql/item_func.cc
parentf827ba3b842d4bd18be37d4b983665b5840251bf (diff)
parent31f34b20f3295db7e99877dcfe61b5798a6cfe95 (diff)
downloadmariadb-git-4dc690dc28d69abcc2be683819d8ab0798df0c9e.tar.gz
Merge remote-tracking branch 'origin/10.1' into 10.2
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 38dc0667e0b..4f8b83e530c 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2512,6 +2512,8 @@ bool Item_func_round::fix_length_and_dec()
precision-= decimals_delta - length_increase;
decimals= MY_MIN(decimals_to_set, DECIMAL_MAX_SCALE);
+ if (!precision)
+ precision= 1; // DECIMAL(0,0) -> DECIMAL(1,0)
max_length= my_decimal_precision_to_length_no_truncation(precision,
decimals,
unsigned_flag);