Several tools don't have --database

Reported by Baron Schwartz on 2012-06-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Medium
Brian Fraser

Bug Description

I think this option ought to be pretty much universal unless we can think of a reason not to use it. It lets us set the initial database for a connection.

tags: added: pt-slave-delay pt-table-checksum standard-options
Changed in percona-toolkit:
status: New → Confirmed
Brian Fraser (fraserbn) wrote :

Looks like pt-slave-delay already has a --database option; ptc doesn't, but has --databases and it's shortcut -d. The attached branch adds a second alias, so that it now accepts --databases, -d, and --database. It's a minor cosmetic fix, but option standardization is a good thing overall.

Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
status: Confirmed → Won't Fix
status: Won't Fix → In Progress
Brian Fraser (fraserbn) on 2012-11-09
Changed in percona-toolkit:
milestone: none → 2.1.7
Changed in percona-toolkit:
milestone: 2.1.7 → 2.1.8
Brian Fraser (fraserbn) on 2012-12-04
summary: - pt-table-checksum and pt-slave-delay don't have --database
+ pt-table-checksum doesn't have --database
tags: removed: pt-slave-delay
Changed in percona-toolkit:
importance: Undecided → Medium

Turns out that all of these lack --database:

pt-archiver
pt-config-diff
pt-deadlock-logger
pt-duplicate-key-checker
pt-fk-error-logger
pt-log-player
pt-online-schema-change
pt-query-digest
pt-table-checksum
pt-table-sync
pt-upgrade
pt-variable-advisor

Daniel Nichter (daniel-nichter) wrote :

And these have --database (-D):

pt-heartbeat
pt-index-usage
pt-kill
pt-query-advisor
pt-show-grants
pt-slave-delay
pt-slave-find
pt-slave-restart
pt-table-usage
pt-visual-explain

So yes, we're rather inconsistent. pt-archiver not having it became an issue recently because shell tools can/should be able to pass everything after -- to a tool, but pt-archiver doesn't have --database. Other standard MySQL program options align like this (by design): --user, --host, etc.

I think we should add --database to all those tools, Brian. Since DSNParser picks up --database because its short form is -D, just adding the option should be enough (then it's magically used as the default db for each connection). But requires, though, that the DSN OPTIONS section lists a D item, because that's part of the magic too.

Brian Fraser (fraserbn) on 2012-12-05
Changed in percona-toolkit:
milestone: 2.1.8 → 2.2.1
summary: - pt-table-checksum doesn't have --database
+ Several tools don't have --database
tags: added: pt-archiver pt-config-diff pt-deadlock-logger pt-duplicate-key-checker pt-fk-error-logger pt-log-player pt-online-schema-change pt-query-digest pt-table-sync pt-upgrade pt-variable-advisor
Brian Fraser (fraserbn) on 2012-12-12
Changed in percona-toolkit:
status: In Progress → Triaged
Brian Fraser (fraserbn) on 2013-03-05
Changed in percona-toolkit:
status: Triaged → In Progress
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers