diff options
author | unknown <bell@51.0.168.192.in-addr.arpa> | 2005-02-20 18:49:27 +0200 |
---|---|---|
committer | unknown <bell@51.0.168.192.in-addr.arpa> | 2005-02-20 18:49:27 +0200 |
commit | ed7ad40523ad890c9229ce4dd32dc48bba196eac (patch) | |
tree | ef69852c850b3445152229f7707b70a1601e70c1 /sql/protocol.cc | |
parent | 5f0064f927aeb897adfc34dd3e739dbaad887482 (diff) | |
parent | da4604f9e8fa42c8e7c5627b692e0ac6d5409802 (diff) | |
download | mariadb-git-ed7ad40523ad890c9229ce4dd32dc48bba196eac.tar.gz |
Merge
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index cfd7a955951..03d02d37d51 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -840,15 +840,9 @@ bool Protocol_simple::store_decimal(const my_decimal *d) field_types[field_pos] == MYSQL_TYPE_NEWDECIMAL); field_pos++; #endif - int buf_size= my_decimal_string_length(d); - char *buff= (char *)my_alloca(buf_size); - String str(buff, buf_size, &my_charset_bin); - if (my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str)) - { - my_afree(buff); - return TRUE; - } - my_afree(buff); + char buff[DECIMAL_MAX_STR_LENGTH]; + String str(buff, sizeof(buff), &my_charset_bin); + (void) my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str); return net_store_data(str.ptr(), str.length()); } @@ -1074,15 +1068,9 @@ bool Protocol_prep::store_decimal(const my_decimal *d) field_types[field_pos] == MYSQL_TYPE_NEWDECIMAL); field_pos++; #endif - int buf_size= my_decimal_string_length(d); - char *buff= (char *)my_alloca(buf_size); - String str(buff, buf_size, &my_charset_bin); - if (my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str)) - { - my_afree(buff); - return TRUE; - } - my_afree(buff); + char buff[DECIMAL_MAX_STR_LENGTH]; + String str(buff, sizeof(buff), &my_charset_bin); + (void) my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str); return store(str.ptr(), str.length(), str.charset()); } |