diff options
author | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-07-30 17:39:54 -0400 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-07-30 17:39:54 -0400 |
commit | 21c55af5a103bcd3133c28073a7cd6e09d0521e3 (patch) | |
tree | a923e10d25fe10c05cc4fa345fd83256896754f2 /sql | |
parent | d605bc56087145d6ffc3139f5ffcf32c6701fa5c (diff) | |
download | mariadb-git-21c55af5a103bcd3133c28073a7cd6e09d0521e3.tar.gz |
WL#3228 (NDB) : RBR using different table defs on slave/master
Minor refactoring to remove compile warnings and possibly fix the
Solaris test failures.
sql/log_event.cc:
WL#3228 (NDB) : RBR using different table defs on slave/master
Minor refactoring.
sql/rpl_utility.cc:
WL#3228 (NDB) : RBR using different table defs on slave/master
Minor refactoring.
sql/rpl_utility.h:
WL#3228 (NDB) : RBR using different table defs on slave/master
Minor refactoring.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 8 | ||||
-rw-r--r-- | sql/rpl_utility.cc | 3 | ||||
-rw-r--r-- | sql/rpl_utility.h | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 22b5a96753d..6f63d8bf718 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6412,7 +6412,7 @@ const int Table_map_log_event::calc_field_metadata_size() case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_SET: { - size= size + sizeof(short int); // Store short int here. + size= size + 2; // Store short int here. break; } default: @@ -6515,7 +6515,7 @@ int Table_map_log_event::save_field_metadata() { char *ptr= (char *)&m_field_metadata[index]; int2store(ptr, m_table->s->field[i]->field_length); - index= index + sizeof(short int); + index= index + 2; break; } case MYSQL_TYPE_STRING: @@ -6709,6 +6709,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len, if (bytes_read < event_len) { m_field_metadata_size= net_field_length(&ptr_after_colcnt); + DBUG_ASSERT(m_field_metadata_size <= (m_colcnt * 2)); uint num_null_bytes= (m_colcnt + 7) / 8; m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME), &m_null_bits, num_null_bytes, @@ -6934,8 +6935,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file) Store the size of the field metadata. */ uchar mbuf[sizeof(m_field_metadata_size)]; - uchar *const mbuf_end= net_store_length(mbuf, - (size_t) m_field_metadata_size); + uchar *const mbuf_end= net_store_length(mbuf, m_field_metadata_size); return (my_b_safe_write(file, dbuf, sizeof(dbuf)) || my_b_safe_write(file, (const uchar*)m_dbnam, m_dblen+1) || diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 279575f33ce..40937e98b27 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -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_len >= 0 && from_bit_len >= 0 && from_bit_len <= 7); + DBUG_ASSERT(from_bit_len >= 0 && from_bit_len <= 7); length= from_len + ((from_bit_len > 0) ? 1 : 0); break; } @@ -121,7 +121,6 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) default: length= -1; } - DBUG_ASSERT(length >= 0); return length; } diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index c91113c9e2a..034b6e084af 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -123,7 +123,7 @@ public: */ char *ptr= (char *)&field_metadata[index]; m_field_metadata[i]= sint2korr(ptr); - index= index + sizeof(short int); + index= index + 2; break; } case MYSQL_TYPE_NEWDECIMAL: @@ -238,7 +238,7 @@ public: private: ulong m_size; // Number of elements in the types array field_type *m_type; // Array of type descriptors - short int *m_field_metadata; + uint16 *m_field_metadata; uchar *m_null_bits; uchar *m_memory; }; |