pt-table-checksum can crash with --columns if none match
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Brian Fraser |
Bug Description
If pt-table-checksum is given the --columns option, it can crash:
$ pt-table-checksum --tables mysql.user --columns foo
06-21T12:03:51 Error checksumming table mysql.user: Use of uninitialized value in concatenation (.) or string at /home/baron/
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
06-21T12:03:51 1 0 0 0 0 0.000 mysql.user
This is because the behavior of --columns is not defined well enough. To fix this, we should modify the tool so that:
1. The documentation states that a --columns list will select all matching columns from the table. If any specified columns don't exist, it is not an error. That is, the columns to be checksummed are an intersection of the columns in the table, and the columns mentioned in --columns.
2. If no columns are to be checksummed, the table should be skipped with this message: "Skipping $table because all columns are excluded by --columns or --ignore-columns."
3. Ensure that the same is true if --ignore-columns filters out all columns.
4. Check other tools that may have --columns or --ignore-columns options also.
Related branches
- Daniel Nichter: Approve
-
Diff: 171 lines (+88/-10)4 files modifiedbin/pt-table-checksum (+22/-6)
lib/RowChecksum.pm (+5/-0)
t/lib/RowChecksum.t (+45/-4)
t/pt-table-checksum/bugs.t (+16/-0)
tags: | added: columns |
Changed in percona-toolkit: | |
assignee: | nobody → Brian Fraser (fraserbn) |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
Changed in percona-toolkit: | |
milestone: | none → 2.1.5 |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
importance: | Undecided → Medium |
Changed in percona-toolkit: | |
milestone: | 2.1.6 → 2.1.5 |
Changed in percona-toolkit: | |
milestone: | 2.1.5 → 2.1.6 |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-547