mariadb/mysql-test
Mats Kindahl 711305e2c5 BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars
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.
2008-06-30 22:11:18 +02:00
..
extra BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars 2008-06-30 22:11:18 +02:00
include Merge magare.gmz:/home/kgeorge/mysql/work/B36011-take2-5.0-bugteam 2008-05-16 19:03:50 +03:00
lib Bug#37069: Make federated disabled by default 2008-05-30 13:21:45 +03:00
misc
ndb
r buckport to 5.1.26 from 6.0 2008-06-27 18:22:23 +05:00
std_data Merge host.loc:/work/bugs/5.0-bugteam-36055 2008-05-13 00:37:45 +05:00
suite BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars 2008-06-30 22:11:18 +02:00
t buckport to 5.1.26 from 6.0 2008-06-27 18:22:23 +05:00
create-test-result
fix-result
install_test_db.sh
Makefile.am Fix of makefile. 2008-04-18 19:22:35 +02:00
mysql-stress-test.pl
mysql-test-run-shell.sh
mysql-test-run.pl Merge bk-internal:/home/bk/mysql-5.0 2008-05-05 15:04:26 +03:00
purify.supp
README
README.gcov
README.stress
resolve-stack
valgrind.supp backport valgrind cleanups from 6.0-engines 2008-02-19 13:46:54 -08:00

This directory contains a test suite for the MySQL daemon. To run
the currently existing test cases, simply execute ./mysql-test-run in
this directory. It will fire up the newly built mysqld and test it.

Note that you do not have to have to do "make install", and you could
actually have a co-existing MySQL installation. The tests will not
conflict with it.

All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:

http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html

If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,
the test suite expects you to provide the names of the tests to run.
For example, here is the command to run the "alias" and "analyze" tests
with an external server:

mysql-test-run --extern alias analyze

To match your setup, you might also need to provide --socket, --user, and
other relevant options.

With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
tests cannot run with an external server.


You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test
extension. For example:

 xemacs t/test_case_name.test

 In the file, put a set of SQL statements that create some tables,
 load test data, and run some queries to manipulate it.

 We would appreciate it if you name your test tables t1, t2, t3 ... (to not
 conflict too much with existing tables).

 Your test should begin by dropping the tables you are going to create and
 end by dropping them again.  This ensures that you can run the test over
 and over again.
 
 If you are using mysqltest commands (like result file names) in your
 test case, you should create the result file as follows:

 mysql-test-run --record test_case_name

 or

 mysqltest --record < t/test_case_name.test

 If you only have a simple test cases consisting of SQL statements and
 comments, you can create the test case in one of the following ways:

 mysql-test-run --record test_case_name

 mysql test < t/test_case_name.test > r/test_case_name.result

 mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test

 When this is done, take a look at r/test_case_name.result
 - If the result is incorrect, you have found a bug. In this case, you should
   edit the test result to the correct results so that we can verify
   that the bug is corrected in future releases.

To submit your test case, put your .test file and .result file(s) into
a tar.gz archive, add a README that explains the problem, ftp the 
archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail
to bugs@lists.mysql.com