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
|
#
# Purpose:
# This test validates that mysqlbinlog is able to annotate compressed column
# types with two levels of verbosity.
#
# Methodology:
# Validate that the output from mysqlbinlog -vv after creating and inserting
# into a table with compressed and uncompressed fields correctly annotates
# which columns are compressed
#
# References:
# MDEV-25277: mysqlbinlog --verbose cannot read row events with compressed
# columns: Don't know how to handle column type: 140
#
--source include/have_binlog_format_row.inc
CREATE TABLE t1 (a TEXT, ac TEXT COMPRESSED, b TINYTEXT, bc TINYTEXT COMPRESSED, c MEDIUMTEXT, cc MEDIUMTEXT COMPRESSED, d LONGTEXT, dc LONGTEXT COMPRESSED, e VARCHAR(10), ec VARCHAR(10) COMPRESSED);
--echo # Isolate row event into its own binary log
FLUSH BINARY LOGS;
INSERT INTO t1 VALUES ('mya', 'myac', 'myb', 'mybc', 'myc', 'mycc', 'myd', 'mydc', 'mye', 'myec');
FLUSH BINARY LOGS;
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
--let $datadir= `SELECT @@datadir`
--let $result_binlog= $MYSQLTEST_VARDIR/tmp/$binlog_file
--echo # MYSQLBINLOG --base64-output=decode-rows -vv datadir/binlog_file --result-file=result_binlog
--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $datadir/$binlog_file --result-file=$result_binlog
--let $assert_file= $result_binlog
--let $assert_count= 1
--let $assert_text= Ensure compressed TEXT fields are annotated correctly
--let $assert_select=\WTEXT COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure compressed TINYTEXT fields are annotated correctly
--let $assert_select=\WTINYTEXT COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure compressed MEDIUMTEXT fields are annotated correctly
--let $assert_select=\WMEDIUMTEXT COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure compressed LONGTEXT fields are annotated correctly
--let $assert_select=\WLONGTEXT COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure compressed VARSTRING fields are annotated correctly
--let $assert_select=\WVARSTRING\(\d+\) COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure COMPRESSED only shows up for corresponding fields
--let $assert_count= 5
--let $assert_select= COMPRESSED
--source include/assert_grep.inc
--let $assert_text= Ensure non-compressed TEXT fields are annotated correctly
--let $assert_count= 8
--let $assert_select=/*.*TEXT
--source include/assert_grep.inc
--let $assert_text= Ensure non-compressed VARSTRING fields are annotated correctly
--let $assert_count= 2
--let $assert_select=/*.*VARSTRING
--source include/assert_grep.inc
# Cleanup
DROP TABLE t1;
|