summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.h
diff options
context:
space:
mode:
authorcbell/Chuck@mysql_cab_desk. <>2007-07-29 18:10:42 -0400
committercbell/Chuck@mysql_cab_desk. <>2007-07-29 18:10:42 -0400
commit537c23e833204511bb1bfa37fb3a97e5ca4c012d (patch)
tree26c861dcc289b76dcb70a1d8206d6ec0405e5b20 /sql/rpl_rli.h
parent8f01f9d02c93f3c90b2e5557eb405b085a903033 (diff)
downloadmariadb-git-537c23e833204511bb1bfa37fb3a97e5ca4c012d.tar.gz
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.
Diffstat (limited to 'sql/rpl_rli.h')
-rw-r--r--sql/rpl_rli.h10
1 files changed, 10 insertions, 0 deletions
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