summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-23 20:16:06 +0200
committerunknown <monty@mysql.com>2005-11-23 20:16:06 +0200
commit0b206536d521b2479feb9eef51484ed8191d6504 (patch)
treeacc41bf0974a50df9867c61707db33ae50dc402e /strings
parent817ee181c34d53caf2179a978c35c685437fb756 (diff)
downloadmariadb-git-0b206536d521b2479feb9eef51484ed8191d6504.tar.gz
Moved long running query to type_newdecimal-big.test
Removed warnings that depends on floating point comparisions in type_newdecimal.test which caused failures in some setups mysql-test/r/type_newdecimal.result: Moved long running query to type_newdecimal-big.test Removed warnings that depends on floating point comparisions mysql-test/t/type_newdecimal.test: Moved long running query to type_newdecimal-big.test Removed warnings that depends on floating point comparisions sql/field.cc: Indentation fixes sql/my_decimal.cc: Fixed that valgrind doesn't give warnings when running with debug strings/decimal.c: More DBUG printing mysql-test/r/type_newdecimal-big.result: New BitKeeper file ``mysql-test/r/type_newdecimal-big.result'' mysql-test/t/type_newdecimal-big.test: New BitKeeper file ``mysql-test/t/type_newdecimal-big.test''
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 0c1f03016e0..9cf4a281be2 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -972,12 +972,18 @@ int decimal2double(decimal_t *from, double *to)
int double2decimal(double from, decimal_t *to)
{
/* TODO: fix it, when we'll have dtoa */
- char s[400], *end;
- sprintf(s, "%.16G", from);
- end= strend(s);
- return string2decimal(s, to, &end);
+ char buff[400], *end;
+ int length, res;
+ DBUG_ENTER("double2decimal");
+ length= my_sprintf(buff, (buff, "%.16G", from));
+ DBUG_PRINT("info",("from: %g from_as_str: %s", from, buff));
+ end= buff+length;
+ res= string2decimal(buff, to, &end);
+ DBUG_PRINT("exit", ("res: %d", res));
+ DBUG_RETURN(res);
}
+
static int ull2dec(ulonglong from, decimal_t *to)
{
int intg1, error=E_DEC_OK;