Commit 67cc50d2 authored by Luis Soares's avatar Luis Soares

PB2 was showing some valgrind warnings after WL#5151 was pushed.

This patch fixes these warnings and some compile time warnings.

On top of that, it also fixes rpl_err_ignoredtable test failure.
This test was failing because the warning suppression text was not
matching the latest text. We fix this by making them match.


mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
  Replaced the suppression text.
sql/rpl_record.cc:
  - Fixed some compile time warnings (replaced %d --> %ld and 
    removed unused mas mask variable.
  - Fixed valgrind warnings when using c_ptr(). Replaced with 
    c_ptr_safe().
sql/rpl_utility.cc:
  - Fixed valgrind warnings when using c_ptr(). Replaced with 
    c_ptr_safe().
parent 56ff29a4
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
create table t1 (a int primary key); create table t1 (a int primary key);
create table t4 (a int primary key); create table t4 (a int primary key);
insert into t1 values (1),(1); insert into t1 values (1),(1);
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
-- source include/master-slave.inc -- source include/master-slave.inc
CALL mtr.add_suppression("Statement may not be safe to log in statement format."); -- disable_query_log
CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT.");
-- enable_query_log
connection master; connection master;
create table t1 (a int primary key); create table t1 (a int primary key);
......
...@@ -222,7 +222,7 @@ unpack_row(Relay_log_info const *rli, ...@@ -222,7 +222,7 @@ unpack_row(Relay_log_info const *rli,
conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL; conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL;
Field *const f= Field *const f=
conv_field ? conv_field : *field_ptr; conv_field ? conv_field : *field_ptr;
DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%d)", DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%ld)",
conv_field ? "" : "not ", conv_field ? "" : "not ",
(*field_ptr)->field_name, field_ptr - begin_ptr)); (*field_ptr)->field_name, field_ptr - begin_ptr));
DBUG_ASSERT(f != NULL); DBUG_ASSERT(f != NULL);
...@@ -313,7 +313,7 @@ unpack_row(Relay_log_info const *rli, ...@@ -313,7 +313,7 @@ unpack_row(Relay_log_info const *rli,
conv_field->val_str(&value_string); conv_field->val_str(&value_string);
DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'", DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'",
(*field_ptr)->field_name, (*field_ptr)->field_name,
source_type.c_ptr(), value_string.c_ptr())); source_type.c_ptr_safe(), value_string.c_ptr_safe()));
#endif #endif
copy.set(*field_ptr, f, TRUE); copy.set(*field_ptr, f, TRUE);
(*copy.do_copy)(&copy); (*copy.do_copy)(&copy);
...@@ -324,7 +324,7 @@ unpack_row(Relay_log_info const *rli, ...@@ -324,7 +324,7 @@ unpack_row(Relay_log_info const *rli,
(*field_ptr)->val_str(&value_string); (*field_ptr)->val_str(&value_string);
DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'", DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'",
(*field_ptr)->field_name, (*field_ptr)->field_name,
target_type.c_ptr(), value_string.c_ptr())); target_type.c_ptr_safe(), value_string.c_ptr_safe()));
#endif #endif
} }
...@@ -419,7 +419,6 @@ int prepare_record(TABLE *const table, ...@@ -419,7 +419,6 @@ int prepare_record(TABLE *const table,
*/ */
for (Field **field_ptr= table->field+skip; *field_ptr; ++field_ptr) for (Field **field_ptr= table->field+skip; *field_ptr; ++field_ptr)
{ {
uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
Field *const f= *field_ptr; Field *const f= *field_ptr;
if ((f->flags & NO_DEFAULT_VALUE_FLAG) && if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM)) (f->real_type() != MYSQL_TYPE_ENUM))
......
...@@ -582,7 +582,7 @@ can_convert_field_to(Field *field, ...@@ -582,7 +582,7 @@ can_convert_field_to(Field *field,
String field_type(field_type_buf, sizeof(field_type_buf), field->charset()); String field_type(field_type_buf, sizeof(field_type_buf), field->charset());
field->sql_type(field_type); field->sql_type(field_type);
DBUG_PRINT("enter", ("field_type: %s, target_type: %d, source_type: %d, source_metadata: 0x%x", DBUG_PRINT("enter", ("field_type: %s, target_type: %d, source_type: %d, source_metadata: 0x%x",
field_type.c_ptr(), field->real_type(), source_type, metadata)); field_type.c_ptr_safe(), field->real_type(), source_type, metadata));
#endif #endif
/* /*
If the real type is the same, we need to check the metadata to If the real type is the same, we need to check the metadata to
...@@ -836,7 +836,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, ...@@ -836,7 +836,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli,
DBUG_PRINT("debug", ("Field %s - conversion required." DBUG_PRINT("debug", ("Field %s - conversion required."
" Source type: '%s', Target type: '%s'", " Source type: '%s', Target type: '%s'",
tmp_table->field[col]->field_name, tmp_table->field[col]->field_name,
source_type.c_ptr(), target_type.c_ptr())); source_type.c_ptr_safe(), target_type.c_ptr_safe()));
} }
} }
#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