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.
The crash appeared to be a result of allocating an instance of Discrete_interval
automatically that that was referred in out-of-declaration scope.
Fixed with correcting backing up and restoring scheme of
auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying;
added simulation code that forces executing those fixes of the former bug that
targeted at master-and-slave having incompatible bug#33029-prone versions.
mysql-test/suite/bugs/r/rpl_bug33029.result:
new results file
mysql-test/suite/bugs/t/rpl_bug33029.test:
test merely checks no crash happens on slave.
sql/slave.cc:
forcing to execute special logics implemented for bug#33029 if
simulate_bug33029 the debug option is set.
sql/sql_class.cc:
swaps of backed and the actual auto_inc_intervals_forced basing on shallow coping.
sql/structs.h:
Removing the deep _copy() and methods associated with it;
adding methods to Discrete_intervals_list:
private `=', copy constructor to prevent using;
private set_members();
public copy_shallow(), swap(), get_{head, tail, current}();
empty_no_free() through set_members().
mysql-test/suite/binlog/r/binlog_multi_engine.result:
updated result
mysql-test/suite/binlog/t/binlog_multi_engine.test:
fix for bug#32663
mysql-test/suite/binlog/t/disabled.def:
updated
mysql-test/suite/rpl/r/rpl_invoked_features.result:
updated result
mysql-test/suite/rpl/t/disabled.def:
updated
mysql-test/suite/rpl/t/rpl_invoked_features.test:
fix for bug#33045
mysql-test/suite/bugs/r/rpl_bug23533.result:
result file
mysql-test/suite/bugs/t/rpl_bug23533.test:
test case for bug#23533
Just adding testcase. This bug was fixed by patch for BUG#31583.
mysql-test/suite/bugs/t/rpl_bug31583.test:
Dropping tables to clean up after the test.
mysql-test/suite/bugs/r/rpl_bug31582.result:
New BitKeeper file ``mysql-test/suite/bugs/r/rpl_bug31582.result''
mysql-test/suite/bugs/t/rpl_bug31582.test:
New BitKeeper file ``mysql-test/suite/bugs/t/rpl_bug31582.test''
In the patch for BUG#21842, the code for handling old rows events were
refactored. There were a bug in the refactored code (possibly introduced
after the patch for BUG#21842) that caused caused the refactored old events
to read a columns bitmap after image even though there is no such bitmap
for old events. As a result, the reading got out of sync, and started reading
invalid data.
This patch removes all trace of the after image column bitmap from the refactored
old events and removes functions that are no longer needed because they are empty.
sql/log_event.cc:
Adding debug printouts and adding old rows events names to output
so that they are not printed as unknown events.
sql/log_event_old.cc:
Adding debug printouts to see how the old events are partitioned
when being decoded. Removing all traces of the column bitmap for
the after image in the old events since there is none.
Removing the following functions since they are no longer needed:
- Update_rows_log_event_old::init()
- Update_rows_log_event_old::~Update_rows_log_event_old()
Removing unused local variable.
sql/log_event_old.h:
Removing all traces of the column bitmap for the after image in
the old events since there is none.
Removing the following functions since they are no longer needed:
- Update_rows_log_event_old::init()
- Update_rows_log_event_old::is_valid()
- Update_rows_log_event_old::~Update_rows_log_event_old()
Removing unused local variable.
mysql-test/suite/bugs/r/rpl_bug31583.result:
New BitKeeper file ``mysql-test/suite/bugs/r/rpl_bug31583.result''
mysql-test/suite/bugs/t/rpl_bug31583.test:
New BitKeeper file ``mysql-test/suite/bugs/t/rpl_bug31583.test''