Commit 12094daa authored by unknown's avatar unknown

Fixes to eliminate valgrind warnings.


sql/rpl_record.cc:
  Factoring out expression and putting it in an auto variable.
sql/rpl_utility.cc:
  Removing a check that causes compile warnings.
sql/rpl_utility.h:
  Ensuring that there is enough memory for the metadata, to avoid reads
  from uninitialized memory. Initializing the memory to keep valgrind
  quiet.
parent 192a8a16
......@@ -250,13 +250,14 @@ unpack_row(RELAY_LOG_INFO const *rli,
We only unpack the field if it was non-null.
Use the master's size information if available else call
normal unpack operation.
*/
*/
#if 0
bool save= table->s->db_low_byte_first;
table->s->db_low_byte_first= TRUE;
bool save= table->s->db_low_byte_first;
table->s->db_low_byte_first= TRUE;
#endif
if (tabledef && tabledef->field_metadata(i))
pack_ptr= f->unpack(f->ptr, pack_ptr, tabledef->field_metadata(i));
uint16 const metadata= tabledef->field_metadata(i);
if (tabledef && metadata)
pack_ptr= f->unpack(f->ptr, pack_ptr, metadata);
else
pack_ptr= f->unpack(f->ptr, pack_ptr);
#if 0
......
......@@ -97,7 +97,7 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data)
{
uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff;
uint from_bit_len= m_field_metadata[col] & 0x00ff;
DBUG_ASSERT(from_bit_len >= 0 && from_bit_len <= 7);
DBUG_ASSERT(from_bit_len <= 7);
length= from_len + ((from_bit_len > 0) ? 1 : 0);
break;
}
......
......@@ -65,10 +65,14 @@ class table_def
m_field_metadata(0), m_null_bits(0), m_memory(NULL)
{
m_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
&m_type, size,
&m_field_metadata, size * sizeof(short),
&m_null_bits, (m_size + 7) / 8,
NULL);
&m_type, size,
&m_field_metadata,
size * sizeof(uint16),
&m_null_bits, (size + 7) / 8,
NULL);
bzero(m_field_metadata, size * sizeof(uint16));
if (m_type)
memcpy(m_type, types, size);
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment