diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-10-09 15:35:22 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-10-12 13:28:10 +0200 |
commit | 6a7c10de92e913c1c9fddbf8ed34693e7d682661 (patch) | |
tree | eaccd2ce93fb42e79fd6588d47cab6e4caf3f3b9 /sql/item_strfunc.cc | |
parent | 284ed643369dec9ff600bf4b2a2d9457986eda6e (diff) | |
download | mariadb-git-6a7c10de92e913c1c9fddbf8ed34693e7d682661.tar.gz |
MDEV-26691 SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a4b17893c46..a9decdbdf04 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1393,7 +1393,10 @@ String *Item_func_sformat::val_str(String *res) break; case DECIMAL_RESULT: // TODO case REAL_RESULT: - vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_real()); + if (args[carg]->field_type() == MYSQL_TYPE_FLOAT) + vargs[carg-1]= fmt::detail::make_arg<ctx>((float)args[carg]->val_real()); + else + vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_real()); break; case STRING_RESULT: if (!(parg= args[carg]->val_str(&val_arg[carg-1]))) |