diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-12-10 16:17:20 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2015-12-10 16:18:15 +0100 |
commit | 537c750e328cd080365e465acd4f0383bf0febf3 (patch) | |
tree | 583a096c5bf18d0b1285f1e87cba9406e71a0b46 /mysys | |
parent | 311f0308d04f3a55ad18470ca39e9d44479c4782 (diff) | |
download | mariadb-git-537c750e328cd080365e465acd4f0383bf0febf3.tar.gz |
MDEV-8521 Drastic loss of precision in COLUMN_JSON() on DOUBLEs
fixed conversion
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/ma_dyncol.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c index 7dfaf29a1a7..06820a0c3c5 100644 --- a/mysys/ma_dyncol.c +++ b/mysys/ma_dyncol.c @@ -3837,7 +3837,9 @@ mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val, return ER_DYNCOL_RESOURCE; break; case DYN_COL_DOUBLE: - len= my_snprintf(buff, sizeof(buff), "%g", val->x.double_value); + + len= my_gcvt(val->x.double_value, MY_GCVT_ARG_DOUBLE, + sizeof(buff) - 1, buff, NULL); if (dynstr_realloc(str, len + (quote ? 2 : 0))) return ER_DYNCOL_RESOURCE; dynstr_append_mem(str, buff, len); |