| 1 |
# |
| 2 |
# Purpose: |
| 3 |
# This test validates that mysqlbinlog is able to annotate compressed column |
| 4 |
# types with two levels of verbosity. |
| 5 |
# |
| 6 |
# Methodology: |
| 7 |
# Validate that the output from mysqlbinlog -vv after creating and inserting |
| 8 |
# into a table with compressed and uncompressed fields correctly annotates |
| 9 |
# which columns are compressed |
| 10 |
# |
| 11 |
# References: |
| 12 |
# MDEV-25277: mysqlbinlog --verbose cannot read row events with compressed |
| 13 |
# columns: Don't know how to handle column type: 140 |
| 14 |
# |
| 15 |
--source include/have_binlog_format_row.inc |
| 16 |
|
| 17 |
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); |
| 18 |
|
| 19 |
--echo # Isolate row event into its own binary log |
| 20 |
FLUSH BINARY LOGS; |
| 21 |
INSERT INTO t1 VALUES ('mya', 'myac', 'myb', 'mybc', 'myc', 'mycc', 'myd', 'mydc', 'mye', 'myec'); |
| 22 |
FLUSH BINARY LOGS; |
| 23 |
|
| 24 |
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2) |
| 25 |
--let $datadir= `SELECT @@datadir` |
| 26 |
--let $result_binlog= $MYSQLTEST_VARDIR/tmp/$binlog_file |
| 27 |
|
| 28 |
--echo # MYSQLBINLOG --base64-output=decode-rows -vv datadir/binlog_file --result-file=result_binlog |
| 29 |
--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $datadir/$binlog_file --result-file=$result_binlog |
| 30 |
|
| 31 |
--let $assert_file= $result_binlog |
| 32 |
--let $assert_count= 1 |
| 33 |
|
| 34 |
--let $assert_text= Ensure compressed TEXT fields are annotated correctly |
| 35 |
--let $assert_select=\WTEXT COMPRESSED |
| 36 |
--source include/assert_grep.inc |
| 37 |
|
| 38 |
--let $assert_text= Ensure compressed TINYTEXT fields are annotated correctly |
| 39 |
--let $assert_select=\WTINYTEXT COMPRESSED |
| 40 |
--source include/assert_grep.inc |
| 41 |
|
| 42 |
--let $assert_text= Ensure compressed MEDIUMTEXT fields are annotated correctly |
| 43 |
--let $assert_select=\WMEDIUMTEXT COMPRESSED |
| 44 |
--source include/assert_grep.inc |
| 45 |
|
| 46 |
--let $assert_text= Ensure compressed LONGTEXT fields are annotated correctly |
| 47 |
--let $assert_select=\WLONGTEXT COMPRESSED |
| 48 |
--source include/assert_grep.inc |
| 49 |
|
| 50 |
--let $assert_text= Ensure compressed VARSTRING fields are annotated correctly |
| 51 |
--let $assert_select=\WVARSTRING\(\d+\) COMPRESSED |
| 52 |
--source include/assert_grep.inc |
| 53 |
|
| 54 |
--let $assert_text= Ensure COMPRESSED only shows up for corresponding fields |
| 55 |
--let $assert_count= 5 |
| 56 |
--let $assert_select= COMPRESSED |
| 57 |
--source include/assert_grep.inc |
| 58 |
|
| 59 |
--let $assert_text= Ensure non-compressed TEXT fields are annotated correctly |
| 60 |
--let $assert_count= 8 |
| 61 |
--let $assert_select=/*.*TEXT |
| 62 |
--source include/assert_grep.inc |
| 63 |
|
| 64 |
--let $assert_text= Ensure non-compressed VARSTRING fields are annotated correctly |
| 65 |
--let $assert_count= 2 |
| 66 |
--let $assert_select=/*.*VARSTRING |
| 67 |
--source include/assert_grep.inc |
| 68 |
|
| 69 |
# Cleanup |
| 70 |
DROP TABLE t1; |