Commit 3805001f authored by unknown's avatar unknown

use dbug_print_decimal instead of DBUG_EXECUTE

Portability fix
Note: rpl_trunc_binlog fails, but Sergei has promised to fix it, so I will ignore it for now


sql/field.cc:
  use dbug_print_decimal instead of DBUG_EXECUTE
sql/item.h:
  Portability fix
sql/my_decimal.cc:
  Fix error in last changeset (not pushed)
parent a39f87f3
...@@ -1557,7 +1557,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) ...@@ -1557,7 +1557,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
my_decimal *dec= (my_decimal*)decimal_value; my_decimal *dec= (my_decimal*)decimal_value;
int error= 0; int error= 0;
DBUG_ENTER("Field_new_decimal::store_value"); DBUG_ENTER("Field_new_decimal::store_value");
DBUG_EXECUTE("enter", print_decimal(dec);); dbug_print_decimal("enter", "value: %s", dec);
/* check that we do not try to write negative value in unsigned field */ /* check that we do not try to write negative value in unsigned field */
if (unsigned_flag && decimal_value->sign()) if (unsigned_flag && decimal_value->sign())
...@@ -1569,7 +1569,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) ...@@ -1569,7 +1569,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
} }
DBUG_PRINT("info", ("saving with precision %d, scale: %d", DBUG_PRINT("info", ("saving with precision %d, scale: %d",
(int)field_length, (int)decimals())); (int)field_length, (int)decimals()));
DBUG_EXECUTE("info", print_decimal(dec);); dbug_print_decimal("info", "value: %s", dec);
if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR &
~E_DEC_OVERFLOW, ~E_DEC_OVERFLOW,
...@@ -1581,8 +1581,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) ...@@ -1581,8 +1581,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
DBUG_PRINT("info", ("overflow")); DBUG_PRINT("info", ("overflow"));
set_value_on_overflow(&buff, dec->sign()); set_value_on_overflow(&buff, dec->sign());
my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, field_length, decimals()); my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, field_length, decimals());
DBUG_EXECUTE("info", print_decimal_buff(&buff, (byte *) ptr, bin_size);); error= 1;
DBUG_RETURN(1);
} }
DBUG_EXECUTE("info", print_decimal_buff(dec, (byte *) ptr, bin_size);); DBUG_EXECUTE("info", print_decimal_buff(dec, (byte *) ptr, bin_size););
DBUG_RETURN(error); DBUG_RETURN(error);
...@@ -1616,7 +1615,7 @@ int Field_new_decimal::store(const char *from, uint length, ...@@ -1616,7 +1615,7 @@ int Field_new_decimal::store(const char *from, uint length,
break; break;
} }
DBUG_EXECUTE("info", print_decimal(&decimal_value);); dbug_print_decimal("enter", "value: %s", &decimal_value);
store_value(&decimal_value); store_value(&decimal_value);
DBUG_RETURN(err); DBUG_RETURN(err);
} }
...@@ -1708,7 +1707,8 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value) ...@@ -1708,7 +1707,8 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value)
binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value, binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
field_length, field_length,
decimals()); decimals());
DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr, bin_size);); DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr,
bin_size););
DBUG_RETURN(decimal_value); DBUG_RETURN(decimal_value);
} }
......
...@@ -463,11 +463,7 @@ class Item_splocal : public Item ...@@ -463,11 +463,7 @@ class Item_splocal : public Item
longlong val_int(); longlong val_int();
String *val_str(String *sp); String *val_str(String *sp);
my_decimal *val_decimal(my_decimal *); my_decimal *val_decimal(my_decimal *);
#ifdef __WIN__
bool is_null(); bool is_null();
#else
inline bool is_null();
#endif
void print(String *str); void print(String *str);
inline void make_field(Send_field *field) inline void make_field(Send_field *field)
......
...@@ -228,7 +228,7 @@ void dbug_print_decimal(const char *tag, const char *format, my_decimal *val) ...@@ -228,7 +228,7 @@ void dbug_print_decimal(const char *tag, const char *format, my_decimal *val)
str.set("NULL", 4, &my_charset_bin); str.set("NULL", 4, &my_charset_bin);
else else
my_decimal2string(0, val, 0, 0, 0, &str); my_decimal2string(0, val, 0, 0, 0, &str);
DBUG_PRINT(tag, (format, val)); DBUG_PRINT(tag, (format, (char*) str.ptr()));
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment