diff options
author | Luis Soares <luis.soares@sun.com> | 2009-12-22 11:51:46 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-12-22 11:51:46 +0000 |
commit | 67cc50d2a36b7b6fbd55cffe02bec413c05365fc (patch) | |
tree | bd1e84321f1908b0494141cf97f33dd76953baa3 | |
parent | 56ff29a422a133a158b20452d078b33c6e99daf3 (diff) | |
download | mariadb-git-67cc50d2a36b7b6fbd55cffe02bec413c05365fc.tar.gz |
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().
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_err_ignoredtable.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_err_ignoredtable.test | 4 | ||||
-rw-r--r-- | sql/rpl_record.cc | 7 | ||||
-rw-r--r-- | sql/rpl_utility.cc | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result index 75fefdad2a2..f211d5d9a2f 100644 --- a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result +++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; 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 t4 (a int primary key); insert into t1 values (1),(1); diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index f358c0ee356..077daba9a3a 100644 --- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -7,7 +7,9 @@ -- 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; create table t1 (a int primary key); diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 00f586cfdd8..c2d3ddbc353 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -222,7 +222,7 @@ unpack_row(Relay_log_info const *rli, conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL; Field *const f= 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 ", (*field_ptr)->field_name, field_ptr - begin_ptr)); DBUG_ASSERT(f != NULL); @@ -313,7 +313,7 @@ unpack_row(Relay_log_info const *rli, conv_field->val_str(&value_string); DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'", (*field_ptr)->field_name, - source_type.c_ptr(), value_string.c_ptr())); + source_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif copy.set(*field_ptr, f, TRUE); (*copy.do_copy)(©); @@ -324,7 +324,7 @@ unpack_row(Relay_log_info const *rli, (*field_ptr)->val_str(&value_string); DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'", (*field_ptr)->field_name, - target_type.c_ptr(), value_string.c_ptr())); + target_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif } @@ -419,7 +419,6 @@ int prepare_record(TABLE *const table, */ 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; if ((f->flags & NO_DEFAULT_VALUE_FLAG) && (f->real_type() != MYSQL_TYPE_ENUM)) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 3a69c71b34c..e8e22216b38 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -582,7 +582,7 @@ can_convert_field_to(Field *field, String field_type(field_type_buf, sizeof(field_type_buf), field->charset()); field->sql_type(field_type); 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 /* 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, DBUG_PRINT("debug", ("Field %s - conversion required." " Source type: '%s', Target type: '%s'", 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 |