Skip to content

Commit 28286c7

Browse files
author
Luis Soares
committed
Fix for rpl_bug31076 valgrind failure which popped up after
WL#5151 was pushed. Problem 1: Some old binlog events do not contain metadata. This makes checking whether the field can be converted or not rather impossible because one cannot compare, for instance, field sizes from original table and target table. Solution 1: When an event does not contain metadata, we will just check if field types are equal and assume that original field definition matched with the one in the target table. Problem 2: There is a second fix, which involves lack of information regarding maybe_null. This was causing a conditional jump warning when creating a conversion table. Solution 2: We will just assume that all fields that need to be in the conversion table may be null.
1 parent 2e35289 commit 28286c7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sql/rpl_utility.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,13 @@ can_convert_field_to(Field *field,
590590
*/
591591
if (field->real_type() == source_type)
592592
{
593+
if (metadata == 0) // Metadata can only be zero if no metadata was provided
594+
{
595+
DBUG_PRINT("debug", ("Base types are identical, but there is no metadata"));
596+
*order_var= 0;
597+
DBUG_RETURN(true);
598+
}
599+
593600
DBUG_PRINT("debug", ("Base types are identical, doing field size comparison"));
594601
if (field->compatible_field_size(metadata, rli, mflags, order_var))
595602
DBUG_RETURN(is_conversion_ok(*order_var, rli));
@@ -920,7 +927,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *
920927
field_def->init_for_tmp_table(type(col),
921928
max_length,
922929
decimals,
923-
maybe_null(col), // maybe_null
930+
TRUE, // maybe_null
924931
FALSE, // unsigned_flag
925932
pack_length);
926933
field_def->charset= target_table->field[col]->charset();

0 commit comments

Comments
 (0)