-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The eve…
…nt was corrupt, leading to illegal data being read This patch changes the way how INET6 is packed to the RBR binary log: - from fixed length 16 bytes - to BINARY(16) compatible variable length style with trailing 0x00 byte compression. This is to make INET6 fully compatible with BINARY(16) in RBR binary logs, so RBR replication works in this scenarios: - Old master BINARY(16) -> New slave INET6 - New master INET6 -> Old slave BINARY(16) A new class StringPack was added to share the code between Field_string and Field_inet6.
- Loading branch information
Showing
11 changed files
with
322 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
plugin/type_inet/mysql-test/type_inet/rpl_row_binary_to_inet6.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
# | ||
# Start of 10.5 tests | ||
# | ||
# | ||
# MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was corrupt, leading to illegal data being read | ||
# | ||
CREATE TABLE t1 (a BINARY(16)); | ||
connection slave; | ||
ALTER TABLE t1 MODIFY a INET6; | ||
connection master; | ||
INSERT INTO t1 VALUES (INET6_ATON('::')); | ||
INSERT INTO t1 VALUES (INET6_ATON('::192.168.0.1')); | ||
INSERT INTO t1 VALUES (INET6_ATON('ffff::')); | ||
INSERT INTO t1 VALUES (INET6_ATON('ffff::192.168.0.1')); | ||
SELECT INET6_NTOA(a) FROM t1 ORDER BY a; | ||
INET6_NTOA(a) | ||
:: | ||
::192.168.0.1 | ||
ffff:: | ||
ffff::c0a8:1 | ||
connection slave; | ||
SELECT * FROM t1 ORDER BY a; | ||
a | ||
:: | ||
::192.168.0.1 | ||
ffff:: | ||
ffff::c0a8:1 | ||
connection master; | ||
DROP TABLE t1; | ||
# | ||
# End of 10.5 tests | ||
# | ||
include/rpl_end.inc |
33 changes: 33 additions & 0 deletions
33
plugin/type_inet/mysql-test/type_inet/rpl_row_binary_to_inet6.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--source include/have_binlog_format_row.inc | ||
--source include/master-slave.inc | ||
|
||
--echo # | ||
--echo # Start of 10.5 tests | ||
--echo # | ||
|
||
--echo # | ||
--echo # MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was corrupt, leading to illegal data being read | ||
--echo # | ||
|
||
CREATE TABLE t1 (a BINARY(16)); | ||
|
||
--sync_slave_with_master | ||
ALTER TABLE t1 MODIFY a INET6; | ||
|
||
--connection master | ||
INSERT INTO t1 VALUES (INET6_ATON('::')); | ||
INSERT INTO t1 VALUES (INET6_ATON('::192.168.0.1')); | ||
INSERT INTO t1 VALUES (INET6_ATON('ffff::')); | ||
INSERT INTO t1 VALUES (INET6_ATON('ffff::192.168.0.1')); | ||
SELECT INET6_NTOA(a) FROM t1 ORDER BY a; | ||
--sync_slave_with_master | ||
SELECT * FROM t1 ORDER BY a; | ||
|
||
--connection master | ||
DROP TABLE t1; | ||
|
||
--echo # | ||
--echo # End of 10.5 tests | ||
--echo # | ||
|
||
--source include/rpl_end.inc |
35 changes: 35 additions & 0 deletions
35
plugin/type_inet/mysql-test/type_inet/rpl_row_inet6_to_binary.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
# | ||
# Start of 10.5 tests | ||
# | ||
# | ||
# MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was corrupt, leading to illegal data being read | ||
# | ||
CREATE TABLE t1 (a INET6); | ||
connection slave; | ||
ALTER TABLE t1 MODIFY a BINARY(16); | ||
connection master; | ||
INSERT INTO t1 VALUES ('::'); | ||
INSERT INTO t1 VALUES ('::192.168.0.1'); | ||
INSERT INTO t1 VALUES ('ffff::'); | ||
INSERT INTO t1 VALUES ('ffff::192.168.0.1'); | ||
SELECT a FROM t1 ORDER BY a; | ||
a | ||
:: | ||
::192.168.0.1 | ||
ffff:: | ||
ffff::c0a8:1 | ||
connection slave; | ||
SELECT INET6_NTOA(a) FROM t1 ORDER BY a; | ||
INET6_NTOA(a) | ||
:: | ||
::192.168.0.1 | ||
ffff:: | ||
ffff::c0a8:1 | ||
connection master; | ||
DROP TABLE t1; | ||
# | ||
# End of 10.5 tests | ||
# | ||
include/rpl_end.inc |
33 changes: 33 additions & 0 deletions
33
plugin/type_inet/mysql-test/type_inet/rpl_row_inet6_to_binary.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--source include/have_binlog_format_row.inc | ||
--source include/master-slave.inc | ||
|
||
--echo # | ||
--echo # Start of 10.5 tests | ||
--echo # | ||
|
||
--echo # | ||
--echo # MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was corrupt, leading to illegal data being read | ||
--echo # | ||
|
||
CREATE TABLE t1 (a INET6); | ||
|
||
--sync_slave_with_master | ||
ALTER TABLE t1 MODIFY a BINARY(16); | ||
|
||
--connection master | ||
INSERT INTO t1 VALUES ('::'); | ||
INSERT INTO t1 VALUES ('::192.168.0.1'); | ||
INSERT INTO t1 VALUES ('ffff::'); | ||
INSERT INTO t1 VALUES ('ffff::192.168.0.1'); | ||
SELECT a FROM t1 ORDER BY a; | ||
--sync_slave_with_master | ||
SELECT INET6_NTOA(a) FROM t1 ORDER BY a; | ||
|
||
--connection master | ||
DROP TABLE t1; | ||
|
||
--echo # | ||
--echo # End of 10.5 tests | ||
--echo # | ||
|
||
--source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.