1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
################################################################################
# WL#4618 RBR: extended table metadata in the binary log
#
# Below metadata is logged into Table_map_log_event
# - signedness of numeric columns
# - charsets of character columns
# - column names
# - set/enum character sets and string values
# - primary key
#
# The first two are always logged. The others are controlled by system
# variable --binlog-row-metadata
#
# The test will verify if the metadata can be logged and printed by mysqlbinlog
# correctly.
# mysqlbinlog --print-table-metadata will print the extra metadata
################################################################################
--source include/have_debug.inc
--source include/have_binlog_format_row.inc
--source include/have_utf32.inc
--source include/test_db_charset_latin1.inc
--let $MYSQLD_DATADIR= `select @@datadir`
--let $binlog_file= $MYSQLD_DATADIR/master-bin.000001
RESET MASTER;
--echo #
--echo # Verify that SET string values and character sets can be printed correctly
--echo #
SET NAMES utf8;
CREATE TABLE t1(
c_set_1 SET("set1_v1_å", "set1_v2_ä", "set1_v3_ö"),
c_set_2 SET("set2_v1_å", "set2_v2_ä", "set2_v3_ö") CHARACTER SET utf32);
SET GLOBAL binlog_row_metadata = MINIMAL;
INSERT INTO t1 VALUES("set1_v1_å", "set2_v2_ä");
--source include/print_optional_metadata.inc
RESET MASTER;
SET GLOBAL binlog_row_metadata = FULL;
INSERT INTO t1 VALUES("set1_v1_å", "set2_v2_ä");
--source include/print_optional_metadata.inc
INSERT INTO t1 VALUES("set1_v3_ö", "set2_v3_ö");
INSERT INTO t1 VALUES("set1_v1_å", "set2_v1_å");
SELECT c_set_1, HEX(c_set_1) FROM t1;
SELECT c_set_2, HEX(c_set_2) FROM t1;
DROP TABLE t1;
RESET MASTER;
--echo #
--echo # Verify that ENUM string values and character sets can be printed correctly
--echo #
CREATE TABLE t1(
c_enum_1 ENUM("enum1_v1_å", "enum1_v2_ä", "enum1_v3_ö"),
c_enum_2 ENUM("enum2_v1_å", "enum2_v2_ä", "enum2_v3_ö") CHARACTER SET utf32);
SET GLOBAL binlog_row_metadata = MINIMAL;
INSERT INTO t1 VALUES("enum1_v1_å", "enum2_v2_ä");
--source include/print_optional_metadata.inc
RESET MASTER;
SET GLOBAL binlog_row_metadata = FULL;
INSERT INTO t1 VALUES("enum1_v1_å", "enum2_v2_ä");
--source include/print_optional_metadata.inc
INSERT INTO t1 VALUES("enum1_v3_ö", "enum2_v3_ö");
INSERT INTO t1 VALUES("enum1_v1_å", "enum2_v1_å");
SELECT c_enum_1, HEX(c_enum_1) FROM t1;
SELECT c_enum_2, HEX(c_enum_2) FROM t1;
DROP TABLE t1;
RESET MASTER;
SET GLOBAL binlog_row_metadata = NO_LOG;
--source include/test_db_charset_restore.inc
|