From 537c23e833204511bb1bfa37fb3a97e5ca4c012d Mon Sep 17 00:00:00 2001 From: "cbell/Chuck@mysql_cab_desk." <> Date: Sun, 29 Jul 2007 18:10:42 -0400 Subject: WL#3228 (NDB) : RBR using different table defs on slave/master This patch adds the ability to store extra field metadata in the table map event. This data can include pack_length() or field_lenght() for fields such as CHAR or VARCHAR enabling developers to add code that can check for compatibilty between master and slave columns. More importantly, the extra field metadata can be used to store data from the master correctly should a VARCHAR field on the master be <= 255 bytes while the same field on the slave is > 255 bytes. The patch also includes the needed changes to unpack to ensure that data which is smaller on the master can be unpacked correctly on the slave. WL#3915 : (NDB) master's cols > slave Slave starts accepting and handling rows of master's tables which have more columns. The most important part of implementation is how to caclulate the amount of bytes to skip for unknown by slave column. --- sql/rpl_rli.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/rpl_rli.h') diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index c458318594a..7ae21897e3f 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -18,6 +18,7 @@ #include "rpl_tblmap.h" #include "rpl_reporting.h" +#include "rpl_utility.h" struct RPL_TABLE_LIST; @@ -301,6 +302,15 @@ typedef struct st_relay_log_info : public Slave_reporting_capability uint tables_to_lock_count; /* RBR: Count of tables to lock */ table_mapping m_table_map; /* RBR: Mapping table-id to table */ + inline table_def *get_tabledef(TABLE *tbl) + { + table_def *td= 0; + for (TABLE_LIST *ptr= tables_to_lock; ptr && !td; ptr= ptr->next_global) + if (ptr->table == tbl) + td= &((RPL_TABLE_LIST *)ptr)->m_tabledef; + return (td); + } + /* Last charset (6 bytes) seen by slave SQL thread is cached here; it helps the thread save 3 get_charset() per Query_log_event if the charset is not -- cgit v1.2.1