pt-find runs exec-plus with nothing to do

Bug #1364288 reported by jgreenso
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Confirmed
Undecided
Unassigned

Bug Description

Got a SQL error logged from crontab which made me suspicious. We find tables and remove them based on age:

/usr/bin/pt-find --config /etc/percona-toolkit.conf --ctime +10 --tbllike 'tablename%' archive --exec-plus 'DROP TABLE %s'

If there are no tables found, a "DROP TABLE " is executed which results in the SQL error. I wasn't expecting exec-plus to operate based on nothing being found.

ii percona-toolkit 2.2.10 Advanced MySQL and system command-line tools

Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :

Able to reproduce the same. There is no table like "tablename" in test database. Still its trying to run DROP TABLE and giving syntax error.

nilnandan@Dell-XPS:~$ pt-find --version
pt-find 2.2.10
nilnandan@Dell-XPS:~$ pt-find --user=root --ask-pass --ctime +10 --tbllike 'tablename%' test --exec-plus 'DROP TABLE %s'
Enter password:
DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [for Statement "DROP TABLE "] at /usr/bin/pt-find line 4119.
nilnandan@Dell-XPS:~$

Changed in percona-toolkit:
status: New → Confirmed
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-1237

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.