pt-show-grants broken on MariaDB 10.x
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
New
|
Undecided
|
Unassigned |
Bug Description
$ wget percona.
$ 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-
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:
Adjusting that check to avoid the -MariaDB case seems to work:
if ( $version !~ "-MariaDB" && VersionCompare:
$ perl pt-show-grants
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 10.1.17-
-- 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;
This bug also affects all my MariaDB 10.1 installations. The following fix works:
``` :cmp($version, '5.7.6') >= 0 ) { :cmp($version, '5.7.6') >= 0 ) {
1924c1924
< if ( VersionCompare:
---
> if ( $version !~ "-MariaDB" && VersionCompare:
```