MDEV-20822 INET6 crashes in combination with RBR extended metadata
The code erroneously assumed that only Field_str descendants can store character set information. After adding Field_inet6, it's not true anymore. Also, after adding Field_inet6, storing field->charset() become not correct either: - Field_inet6::charset() return &my_charset_latin1, because clients see INET6 as VARCHAR(39). - Field_inet6::binlog_type_info().m_cs returns &my_charset_bin because storage engines see INET6 as BINARY(16). We need to store &my_charset_bin to the binlog metadata, so the slave sees INET6 as BINARY(16), like storage engines do, to make the slave treat the replicated data as binary IPv6 address representation (rather than text representation). The correct character set that needs to be stored to the metadata is already populated to binlog_type_info_array[i].m_cs. So the fixed code version uses this value rather than field->charset().
Showing
Please register or sign in to comment