Debian Codegraph @

mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_binary.test

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