pt-table-checksum privilege check fails on MySQL 5.5

Bug #916168 reported by Aurimas Mikalauskas
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Daniel Nichter
2.0
Won't Fix
Undecided
Unassigned
2.1
Fix Released
Medium
Daniel Nichter

Bug Description

If percona.checksum table exists, privileges check fails with the following error:

01-13T12:21:20 User does not have all privileges on --replicate table `percona`.`checksums`.

Here's the PTDEBUG output:

# pt_table_checksum:6995 6643 Checking --replicate table `percona`.`checksums`
# pt_table_checksum:7000 6643 SHOW DATABASES LIKE 'percona'
# pt_table_checksum:7098 6643 use_repl_db
# pt_table_checksum:7119 6643 USE `percona`
# TableParser:1952 6643 Checking `percona`.`checksums`
# TableParser:1956 6643 SHOW TABLES FROM `percona` LIKE 'checksums'
# TableParser:1970 6643 Table exists; no privs to check
# pt_table_checksum:7033 6643 --replicate table `percona`.`checksums` already exists
# TableParser:1952 6643 Checking `percona`.`checksums`
# TableParser:1956 6643 SHOW TABLES FROM `percona` LIKE 'checksums'
# TableParser:1970 6643 Table exists; no privs to check
# TableParser:1974 6643 SHOW FULL COLUMNS FROM `percona`.`checksums`
# TableParser:1989 6643 DELETE FROM `percona`.`checksums` LIMIT 0
# TableParser:1995 6643 User privs on `percona`.`checksums` : select delete
# TableParser:2000 6643 User does not have all privs
01-13T12:21:20 User does not have all privileges on --replicate table `percona`.`checksums`.
# Cxn:1514 6643 Disconnecting dbh DBI::db=HASH(0xffdb2c0) undef
# Cxn:1514 6643 Disconnecting dbh DBI::db=HASH(0x1038c830) undef

When I drop the table, everything starts up just fine. I have created the following privileges:

grant select, replication slave, replication client, super, process on *.* to 'u'@'10.0.0.0/255.255.255.0' identified by 'p';
grant all on percona.* to 'u'@'10.0.0.0/255.255.255.0';
create database percona;

And I run check as:

perl pt-table-checksum h=10.0.0.1,u=u,p=p

On 5.5.14-55-log Percona Server (GPL), Release rel20.5, Revision 149

Aurimas

Related branches

tags: added: privs pt-table-checksum
Changed in percona-toolkit:
status: New → Confirmed
Revision history for this message
Baron Schwartz (baron-xaprb) wrote :

Bug 1003939 is a duplicate of this one. There is some useful discussion in the comments thread on that bug.

Changed in percona-toolkit:
milestone: none → 2.1.3
Changed in percona-toolkit:
importance: Undecided → Medium
Changed in percona-toolkit:
status: Confirmed → In Progress
assignee: nobody → Daniel Nichter (daniel-nichter)
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

This is a MySQL 5.5 issue because the test I just pushed works on 5.1 but fails on 5.5.

tags: added: mysql-5.5
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

For the record:

mysql> SHOW GRANTS FOR CURRENT_USER\G

5.1
===

*************************** 1. row ***************************
Grants for test_user@%: GRANT SELECT, PROCESS, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'test_user'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
*************************** 2. row ***************************
Grants for test_user@%: GRANT ALL PRIVILEGES ON `percona`.* TO 'test_user'@'%'

5.5.21
======

*************************** 1. row ***************************
Grants for test_user@%: GRANT SELECT, PROCESS, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'test_user'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
*************************** 2. row ***************************
Grants for test_user@%: GRANT ALL PRIVILEGES ON `percona`.* TO 'test_user'@'%'

Identical grants, but:

mysql> USE percona; SHOW FULL COLUMNS FROM checksums\G

5.1
===

*************************** 1. row ***************************
     Field: db
      Type: char(64)
 Collation: latin1_swedish_ci
      Null: NO
       Key: PRI
   Default: NULL
     Extra:
Privileges: select,insert,update,references
   Comment:

5.5.21
======

*************************** 1. row ***************************
     Field: db
      Type: char(64)
 Collation: latin1_swedish_ci
      Null: NO
       Key: PRI
   Default: NULL
     Extra:
Privileges: select
   Comment:

So as Baron said in bug 916168, I'm just going to remove the privs check and let the tool either work or not, and if it doesn't, then the user will know without a doubt that they need to fix the user's privs.

tags: added: mysql-bug
summary: - bug in pt-table-checksum privileges check
+ pt-table-checksum privileges check fail on MySQL 5.5
summary: - pt-table-checksum privileges check fail on MySQL 5.5
+ pt-table-checksum privilege check fails on MySQL 5.5
Revision history for this message
Sheeri K. Cabral (awfief) wrote :

Daniel , Baron - that is perfectly agreeable to me, thanx!

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-450

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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