summaryrefslogtreecommitdiff
path: root/sql/slave.h
diff options
context:
space:
mode:
authorMats Kindahl <mats@mysql.com>2008-06-30 22:11:18 +0200
committerMats Kindahl <mats@mysql.com>2008-06-30 22:11:18 +0200
commit2a089557a68107925f1f1e197db65d04b5bf377b (patch)
tree99d0103a1bedf9e6a2c68aa7ca343d20d8dafc6d /sql/slave.h
parent5672b953cca4ba36b2ba1b61aeeeecbbf99815bd (diff)
downloadmariadb-git-2a089557a68107925f1f1e197db65d04b5bf377b.tar.gz
BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars
In order to handle CHAR() fields, 8 bits were reserved for the size of the CHAR field. However, instead of denoting the number of characters in the field, field_length was used which denotes the number of bytes in the field. Since UTF-8 fields can have three bytes per character (and has been extended to have four bytes per character in 6.0), an extra two bits have been encoded in the field metadata work for fields of type Field_string (i.e., CHAR fields). Since the metadata word is filled, the extra bits have been encoded in the upper 4 bits of the real type (the most significant byte of the metadata word) by computing the bitwise xor of the extra two bits. Since the upper 4 bits of the real type always is 1111 for Field_string, this means that for fields of length <256, the encoding is identical to the encoding used in pre-5.1.26 servers, but for lengths of 256 or more, an unrecognized type is formed, causing an old slave (that does not handle lengths of 256 or more) to stop.
Diffstat (limited to 'sql/slave.h')
-rw-r--r--sql/slave.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/slave.h b/sql/slave.h
index 80d267e5b27..dc2d668c97b 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -165,7 +165,8 @@ int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
bool show_master_info(THD* thd, Master_info* mi);
bool show_binlog_info(THD* thd);
-bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report=TRUE);
+bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
+ bool (*pred)(const void *), const void *param);
bool rpl_master_erroneous_autoinc(THD* thd);
const char *print_slave_db_safe(const char *db);