diff options
author | Luis Soares <luis.soares@oracle.com> | 2011-05-24 00:33:55 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2011-05-24 00:33:55 +0100 |
commit | 79f8d024b8fc73f310b255862d2797004b99871d (patch) | |
tree | 786bf19ddff57c089f3cfe1ce156bf8ee542b99e | |
parent | ef8b4f22f665b5c7f087651530072cf7342bd321 (diff) | |
parent | 1e495b270f7cbcfee346115666c9bc0ff5c16aea (diff) | |
download | mariadb-git-79f8d024b8fc73f310b255862d2797004b99871d.tar.gz |
BUG#12558519
Automerged bzr bundle from bug report into latest mysql-5.5.
-rw-r--r-- | sql/log_event.cc | 1 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 10 | ||||
-rw-r--r-- | sql/table.cc | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 39b4791ff3d..763bbf81a81 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -8441,6 +8441,7 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli) m_field_metadata, m_field_metadata_size, m_null_bits, m_flags); table_list->m_tabledef_valid= TRUE; + table_list->m_conv_table= NULL; table_list->open_type= OT_BASE_ONLY; /* diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 9a5c7521752..e72c813f09f 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1258,6 +1258,16 @@ void Relay_log_info::clear_tables_to_lock() tables_to_lock->m_tabledef.table_def::~table_def(); tables_to_lock->m_tabledef_valid= FALSE; } + + /* + If blob fields were used during conversion of field values + from the master table into the slave table, then we need to + free the memory used temporarily to store their values before + copying into the slave's table. + */ + if (tables_to_lock->m_conv_table) + free_blobs(tables_to_lock->m_conv_table); + tables_to_lock= static_cast<RPL_TABLE_LIST*>(tables_to_lock->next_global); tables_to_lock_count--; diff --git a/sql/table.cc b/sql/table.cc index 351e80627eb..c62d84743bc 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2189,7 +2189,15 @@ void free_blobs(register TABLE *table) for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ; ptr != end ; ptr++) - ((Field_blob*) table->field[*ptr])->free(); + { + /* + Reduced TABLE objects which are used by row-based replication for + type conversion might have some fields missing. Skip freeing BLOB + buffers for such missing fields. + */ + if (table->field[*ptr]) + ((Field_blob*) table->field[*ptr])->free(); + } } |