diff options
author | monty@mysql.com <> | 2005-02-19 18:58:27 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2005-02-19 18:58:27 +0200 |
commit | 218e00ac681c300ddfb59889d8b6dd7faa0e71f6 (patch) | |
tree | 45069dd14961944b02845ab6e42f1993666f63e8 /sql/protocol.cc | |
parent | 7bc48798fce1b4010adbd074aa18784fcf0eb07e (diff) | |
download | mariadb-git-218e00ac681c300ddfb59889d8b6dd7faa0e71f6.tar.gz |
Fixed BUILD script to use --with-berkeley-db instead of --with-bdb
Lots of small fixes to multi-precision-math path
Give Note for '123.4e'
Added helper functions type 'val_string_from_real()
Don't give warnings for end space for string2decimal()
Changed storage of values for SP so that we can detect length of argument without strlen()
Changed interface for str2dec() so that we must supple the pointer to the last character in the buffer
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 7c56bb3fc7a..657341b8bdc 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -822,15 +822,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()); } @@ -1056,15 +1050,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()); } |