From 0b206536d521b2479feb9eef51484ed8191d6504 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Nov 2005 20:16:06 +0200 Subject: 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'' --- sql/my_decimal.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sql/my_decimal.cc') diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 1bd16940b47..89607129026 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -193,16 +193,23 @@ int str2my_decimal(uint mask, const char *from, uint length, #ifndef DBUG_OFF /* routines for debugging print */ +#define DIG_PER_DEC1 9 +#define ROUND_UP(X) (((X)+DIG_PER_DEC1-1)/DIG_PER_DEC1) + /* print decimal */ void print_decimal(const my_decimal *dec) { - fprintf(DBUG_FILE, - "\nDecimal: sign: %d intg: %d frac: %d \n\ -%09d,%09d,%09d,%09d,%09d,%09d,%09d,%09d\n", - dec->sign(), dec->intg, dec->frac, - dec->buf[0], dec->buf[1], dec->buf[2], dec->buf[3], - dec->buf[4], dec->buf[5], dec->buf[6], dec->buf[7]); + int i, end; + char buff[512], *pos; + pos= buff; + pos+= my_sprintf(buff, (buff, "Decimal: sign: %d intg: %d frac: %d { ", + dec->sign(), dec->intg, dec->frac)); + end= ROUND_UP(dec->frac)+ROUND_UP(dec->intg)-1; + for (i=0; i < end; i++) + pos+= my_sprintf(pos, (pos, "%09d, ", dec->buf[i])); + pos+= my_sprintf(pos, (pos, "%09d }\n", dec->buf[i])); + fputs(buff, DBUG_FILE); } -- cgit v1.2.1