pt-table-checksum reports misleading error if comment contains '>' character

Bug #1743349 reported by Predrag Zecevic on 2018-01-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

Hi all,
this is similar to https://bugs.launchpad.net/percona-toolkit/+bug/1708749 bug...

I have tested it only for comments containing '>' character (2 of them). Probably, '<' could cause similar problem.

I have used same method to test, as in mentioned bug 1708749:

$ ./mtr --suite=rpl --start rpl_alter &
Logging: ./mtr --suite=rpl --start rpl_alter
MySQL Version 5.7.20
Checking supported features...
 - SSL connections supported
Collecting tests...
Removing old var directory...
Creating var directory '/opt/MySQL/5.7.20_64/mysql-test/var'...
Installing system database...
Using parallel: 1

==============================================================================

TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
worker[1] mysql-test-run: WARNING: running this script as _root_ will cause some tests to be skipped
worker[1]
Started [mysqld.1 - pid: 28741, winpid: 28741] [mysqld.2 - pid: 28743, winpid: 28743]
worker[1] Using config for test rpl.rpl_alter
worker[1] Port and socket path for server(s):
worker[1] mysqld.1 13000 /opt/MySQL/5.7.20_64/mysql-test/var/tmp/mysqld.1.sock
worker[1] mysqld.2 13001 /opt/MySQL/5.7.20_64/mysql-test/var/tmp/mysqld.2.sock
worker[1] Waiting for server(s) to exit...

$ mysql --user root --socket=/opt/MySQL/5.7.20_64/mysql-test/var/tmp/mysqld.1.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.20-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database ptest;
Query OK, 1 row affected (0,00 sec)
mysql> use ptest
Database changed
mysql> create table tbl_test (id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The unique identifier of this table.', currency char(3) NOT NULL DEFAULT '' COMMENT 'currency (service charge) derived (C --> B --> C).', remark1 mediumtext COMMENT 'Generated from 1', remark2 mediumtext COMMENT 'Generated from 2', PRIMARY KEY (id)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 STATS_PERSISTENT=1;
Query OK, 0 rows affected (0,00 sec)

mysql> show create table tbl_test\G
*************************** 1. row ***************************
       Table: tbl_test
Create Table: CREATE TABLE `tbl_test` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The unique identifier of this table.',
  `currency` char(3) NOT NULL DEFAULT '' COMMENT 'currency (service charge) derived (C --> B --> C).',
  `remark1` mediumtext COMMENT 'Generated from 1',
  `remark2` mediumtext COMMENT 'Generated from 2',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=1
1 row in set (0,02 sec)
mysql> insert into tbl_test values (1, 'XYZ', 'blha, blah', 'foo bar');
Query OK, 1 row affected (0,00 sec)

mysql> ^DBye

$ mysql --user root --socket=/opt/MySQL/5.7.20_64/mysql-test/var/tmp/mysqld.2.sock --execute "show create table ptest.tbl_test\G"
*************************** 1. row ***************************
       Table: tbl_test
Create Table: CREATE TABLE `tbl_test` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The unique identifier of this table.',
  `currency` char(3) NOT NULL DEFAULT '' COMMENT 'currency (service charge) derived (C --> B --> C).',
  `remark1` mediumtext COMMENT 'Generated from 1',
  `remark2` mediumtext COMMENT 'Generated from 2',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 STATS_PERSISTENT=1

$ pt-table-checksum --version
pt-table-checksum 3.0.5
$ pt-table-checksum h=127.0.0.1,P=13000,u=root --set-vars innodb_lock_wait_timeout=50 --no-check-binlog-format --ignore-databases mysql --nocheck-replication-filters

# A software update is available:
            TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
01-15T11:09:46 0 0 131 1 0 0.010 mtr.global_suppressions
01-15T11:09:46 0 0 0 1 0 0.007 mtr.test_suppressions
01-15T11:09:46 Skipping table ptest.tbl_test because it has problems on these replicas:
Table ptest.tbl_test on replica solarix is missing these columns: remark1, remark2
This can break replication. If you understand the risks, specify --no-check-slave-tables to disable this check.
01-15T11:09:46 0 0 6 1 0 0.006 sys.sys_config

Two '>' characters caused "failure" (I guess that number of reported columns with error, corresponds to number of offending characters). Most likely '<' and few more legal comment characters can cause similar problem...

Definition from https://dev.mysql.com/doc/refman/5.7/en/create-table.html:

COMMENT:
* A comment for a column can be specified with the COMMENT option, up to 1024 characters long. The comment is displayed by the SHOW CREATE TABLE and SHOW FULL COLUMNS statements.

No limitation, just says: 'string'

Regards.

description: updated
description: updated
description: updated

Created https://jira.percona.com/browse/PT-248 to track this issue.

Is my account transferred there (to JIRA)?
I can access, but cannot comment (is that expected behaviour?).
Regards.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1471

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers