pt-show-grants broken on MariaDB 10.x

Bug #1619528 reported by Andrew Garner
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

$ wget percona.com/get/pt-show-grants

$ perl pt-show-grants --version
pt-show-grants 2.2.19

$ perl pt-show-grants
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 10.1.17-MariaDB-1~jessie at 2016-09-02 03:43:12
Use of uninitialized value $create in substitution (s///) at pt-show-grants line 1937.

This seems to be due to applying the 5.7.6+ logic to MariaDB:

      if ( VersionCompare::cmp($version, '5.7.6') >= 0 ) {

Adjusting that check to avoid the -MariaDB case seems to work:

      if ( $version !~ "-MariaDB" && VersionCompare::cmp($version, '5.7.6') >= 0 ) {

$ perl pt-show-grants
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 10.1.17-MariaDB-1~jessie at 2016-09-02 03:50:53
-- Grants for 'root'@'localhost'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION;
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION;

Revision history for this message
Pim Rupert (prupert) wrote :

This bug also affects all my MariaDB 10.1 installations. The following fix works:

```
1924c1924
< if ( VersionCompare::cmp($version, '5.7.6') >= 0 ) {
---
> if ( $version !~ "-MariaDB" && VersionCompare::cmp($version, '5.7.6') >= 0 ) {
```

Revision history for this message
Gaëtan Trellu (goldyfruit) wrote :

Same for me with the current versions:
  - percona-toolkit-2.2.19-1.noarch
  - MariaDB-server-10.1.17-1.el7.centos.x86_64

The workaround above works for me.

Revision history for this message
Vide (vide80) wrote :

I'm affected by this too. Another workaround is to revert to pt 2.2.16 (before #143537 fix was applied)

Revision history for this message
Vide (vide80) wrote :

Sorry, didn't see that there is another bug for this issue and that the fix is already committed there :(

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.