summaryrefslogtreecommitdiff
path: root/sql/rpl_utility.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2010-01-07 01:04:38 +0000
committerLuis Soares <luis.soares@sun.com>2010-01-07 01:04:38 +0000
commit28286c74945e4fc4b00dcea2fcdc199e786d3a1b (patch)
tree512321d746d6dfe31b1558bc753cd44db3e19fee /sql/rpl_utility.cc
parent2e35289e32fcde8ca0dd95e77432969009b05ace (diff)
downloadmariadb-git-28286c74945e4fc4b00dcea2fcdc199e786d3a1b.tar.gz
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.
Diffstat (limited to 'sql/rpl_utility.cc')
-rw-r--r--sql/rpl_utility.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 3d5b3baad30..16eaae9b91d 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -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();