mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
711305e2c5
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. mysql-test/extra/rpl_tests/rpl_row_basic.test: Adding test cases for replicating UTF-8 fields of lengths of 256 or more (bytes). mysql-test/suite/binlog/r/binlog_base64_flag.result: Result file change. mysql-test/suite/binlog/t/binlog_base64_flag.test: Adding tests to trigger check that an error is generated when replicating from a 5.1.25 server for tables with a CHAR(128) but not when replicating a table with a CHAR(63). Although the bug indicates that the limit is 83, we elected to use CHAR(63) since 6.0 uses 4-byte UTF-8, and anything exceeding 63 would then cause the test to fail when the patch is merged to 6.0. mysql-test/suite/bugs/combinations: Adding combinations file to run all bug reports in all binlog modes (where applicable). mysql-test/suite/bugs/r/rpl_bug37426.result: Result file change. mysql-test/suite/bugs/t/rpl_bug37426.test: Added test for reported bug. mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result: Result file change. mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result: Result file change. sql/field.cc: Encoding an extra two bits in the most significant nibble (4 bits) of the metadata word. Adding assertions to ensure that no attempt is made to use lengths longer than supported. Extending compatible_field_size() function with an extra parameter holding a Relay_log_instace for error reporting. Field_string::compatible_field_size() now reports an error if field size for a CHAR is >255. sql/field.h: Field length is now computed from most significant 4 bits of metadata word, or is equal to the row pack length if there is no metadata. Extending compatible_field_size() function with an extra parameter holding a Relay_log_instace for error reporting. sql/rpl_utility.cc: Adding relay log parameter to compatible_field_size(). Minor refactoring to eliminate duplicate code. sql/slave.cc: Extending rpl_master_has_bug() with a single-argument predicate function and a parameter to the predicate function. The predicate function can be used to test for extra conditions for the bug before writing an error message. sql/slave.h: Extending rpl_master_has_bug() with a single-argument predicate function and a parameter to the predicate function. The predicate function can be used to test for extra conditions for the bug before writing an error message. Also removing gratuitous default argument. sql/sql_insert.cc: Changing calls to rpl_master_has_bug() to adapt to changed signature.
93 lines
2.9 KiB
Text
93 lines
2.9 KiB
Text
DROP TABLE IF EXISTS t1;
|
|
==== Test BUG#32407 ====
|
|
select * from t1;
|
|
a
|
|
1
|
|
1
|
|
==== Test BINLOG statement w/o FD event ====
|
|
BINLOG '
|
|
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
|
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
|
|
';
|
|
ERROR HY000: The BINLOG statement of type `Table_map` was not preceded by a format description BINLOG statement.
|
|
select * from t1;
|
|
a
|
|
1
|
|
1
|
|
==== Test BINLOG statement with FD event ====
|
|
BINLOG '
|
|
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
|
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
|
';
|
|
BINLOG '
|
|
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
|
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
|
';
|
|
select * from t1;
|
|
a
|
|
1
|
|
1
|
|
3
|
|
==== Test --base64-output=never on a binlog with row events ====
|
|
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
|
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
|
DELIMITER /*!*/;
|
|
# at 4
|
|
<#>ROLLBACK/*!*/;
|
|
# at 102
|
|
<#>use test/*!*/;
|
|
SET TIMESTAMP=1196959712/*!*/;
|
|
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
|
|
SET @@session.sql_mode=0/*!*/;
|
|
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
|
/*!\C latin1 *//*!*/;
|
|
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
|
SET @@session.lc_time_names=0/*!*/;
|
|
SET @@session.collation_database=DEFAULT/*!*/;
|
|
create table t1 (a int) engine= myisam
|
|
/*!*/;
|
|
# at 203
|
|
DELIMITER ;
|
|
# End of log file
|
|
ROLLBACK /* added by mysqlbinlog */;
|
|
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
|
==== Test non-matching FD event and Row event ====
|
|
BINLOG '
|
|
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
|
|
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
|
|
';
|
|
BINLOG '
|
|
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
|
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
|
|
';
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
|
|
select * from t1;
|
|
a
|
|
1
|
|
1
|
|
3
|
|
CREATE TABLE char128_utf8 (
|
|
i1 INT NOT NULL,
|
|
c CHAR(128) CHARACTER SET utf8 NOT NULL,
|
|
i2 INT NOT NULL);
|
|
CREATE TABLE char63_utf8 (
|
|
i1 INT NOT NULL,
|
|
c CHAR(63) CHARACTER SET utf8 NOT NULL,
|
|
i2 INT NOT NULL);
|
|
BINLOG '
|
|
MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
|
AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
|
';
|
|
BINLOG '
|
|
3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A
|
|
3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA
|
|
';
|
|
SELECT * FROM char63_utf8;
|
|
i1 c i2
|
|
1 123 1
|
|
BINLOG '
|
|
iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA==
|
|
iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
|
|
';
|
|
ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
|
|
drop table t1, char63_utf8, char128_utf8;
|