mirror of
https://github.com/MariaDB/server.git
synced 2025-07-08 17:02:21 +03:00
WL#5151: Conversion between different types when replicating
Row-based replication requires the types of columns on the master and slave to be approximately the same (some safe conversions between strings are allowed), but does not allow safe conversions between fields of similar types such as TINYINT and INT. This patch implement type conversions between similar fields on the master and slave. The conversions are controlled using a new variable SLAVE_TYPE_CONVERSIONS of type SET('ALL_LOSSY','ALL_NON_LOSSY'). Non-lossy conversions are any conversions that do not run the risk of losing any information, while lossy conversions can potentially truncate the value. The column definitions are checked to decide if the conversion is acceptable. If neither conversion is enabled, it is required that the definitions of the columns are identical on master and slave. Conversion is done by creating an internal conversion table, unpacking the master data into it, and then copy the data to the real table on the slave.
This commit is contained in:
@ -86,6 +86,12 @@ enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
|
||||
enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT,
|
||||
SLAVE_EXEC_MODE_IDEMPOTENT,
|
||||
SLAVE_EXEC_MODE_LAST_BIT};
|
||||
enum enum_slave_type_conversions {
|
||||
SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
|
||||
SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY,
|
||||
SLAVE_TYPE_CONVERSIONS_COUNT
|
||||
};
|
||||
|
||||
enum enum_mark_columns
|
||||
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
|
||||
|
||||
|
Reference in New Issue
Block a user