diff options
author | Luis Soares <luis.soares@oracle.com> | 2011-05-23 23:46:51 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2011-05-23 23:46:51 +0100 |
commit | 1e495b270f7cbcfee346115666c9bc0ff5c16aea (patch) | |
tree | 1213d7c85a7130ea7be8174c3b36de46909a7b99 /sql/table.cc | |
parent | 4112a5213f9c19ff7a246076d191c3b556afd1de (diff) | |
download | mariadb-git-1e495b270f7cbcfee346115666c9bc0ff5c16aea.tar.gz |
BUG#12558519: RPL_TYPECONV PRODUCES VALGRIND STACK
In RBR and in case of converting blob fields, the space allocated
while unpacking into the conversion field was not freed after
copying from it into the real field.
We fix this by freeing the conversion field when the conversion
table is not needed anymore (on close_tables_to_lock).
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 68e2566ffc1..8073120e530 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2188,7 +2188,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(); + } } |