1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Luis Soares
2010-01-07 01:04:38 +00:00
parent 9e2c9cd2c0
commit a533cec71b

View File

@ -590,6 +590,13 @@ can_convert_field_to(Field *field,
*/
if (field->real_type() == source_type)
{
if (metadata == 0) // Metadata can only be zero if no metadata was provided
{
DBUG_PRINT("debug", ("Base types are identical, but there is no metadata"));
*order_var= 0;
DBUG_RETURN(true);
}
DBUG_PRINT("debug", ("Base types are identical, doing field size comparison"));
if (field->compatible_field_size(metadata, rli, mflags, order_var))
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 *
field_def->init_for_tmp_table(type(col),
max_length,
decimals,
maybe_null(col), // maybe_null
TRUE, // maybe_null
FALSE, // unsigned_flag
pack_length);
field_def->charset= target_table->field[col]->charset();