pt-table-checksum can crash with --columns if none match

Bug #1016131 reported by Baron Schwartz
12
This bug affects 2 people
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/2.1/bin/pt-table-checksum line 3200.

            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

tags: added: columns
Brian Fraser (fraserbn)
Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Confirmed → In Progress
Brian Fraser (fraserbn)
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
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.