summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-10-13 14:42:36 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-10-13 14:42:36 -0400
commitfd68a7dac625be8ba64745474d85f689ddeb9ea0 (patch)
tree96c409790c0a8213ce3432befe8e20e4137231ae /sql/log_event.cc
parent13615c5e18eed62fa2dee80402dfebe3e74053c4 (diff)
parent16c4b3c68b06653592a9500050ad977a38f4ebae (diff)
downloadmariadb-git-fd68a7dac625be8ba64745474d85f689ddeb9ea0.tar.gz
Merge tag 'mariadb-5.5.46' into 5.5-galera
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 0e10b148097..5e9ee6136a9 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2015,15 +2015,10 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
my_decimal dec;
binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) ptr, &dec,
precision, decimals);
- int i, end;
- char buff[512], *pos;
- pos= buff;
- pos+= sprintf(buff, "%s", dec.sign() ? "-" : "");
- end= ROUND_UP(dec.frac) + ROUND_UP(dec.intg)-1;
- for (i=0; i < end; i++)
- pos+= sprintf(pos, "%09d.", dec.buf[i]);
- pos+= sprintf(pos, "%09d", dec.buf[i]);
- my_b_printf(file, "%s", buff);
+ int length= DECIMAL_MAX_STR_LENGTH;
+ char buff[DECIMAL_MAX_STR_LENGTH + 1];
+ decimal2string(&dec, buff, &length, 0, 0, 0);
+ my_b_write(file, (uchar*)buff, length);
my_snprintf(typestr, typestr_length, "DECIMAL(%d,%d)",
precision, decimals);
return bin_size;