diff options
Diffstat (limited to 'sql/item.cc')
| -rw-r--r-- | sql/item.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 5bcddb5cd67..b5998c58b44 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2689,6 +2689,25 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll, } +bool +Item_func_or_sum + ::check_decimal_scale_or_error(decimal_digits_t max_allowed_decimals) const +{ + if (decimals > max_allowed_decimals) + { + /* + Historically MariaDB raises ER_TOO_BIG_PRECISION + instead of ER_TOO_BIG_SCALE when checking fractional digits + of an SQL function. Perhaps should be fixed eventually. + */ + my_error(ER_TOO_BIG_PRECISION, MYF(0), func_name(), max_allowed_decimals); + return true; + } + return false; +} + + + /** @brief Building clone for Item_func_or_sum |
