Comment 6 for bug 844034

Revision history for this message
William Taylor (williamt-sonic) wrote :

Thanks Barron. In hindsight I probably should have submitted this as a separate bug. Here is an updated patch.
My original patch only fixed running with --revoke this fixes running with --separate also.

If u have a GRANT PROXY option --revoke and or --separate will fail because the regex pt-show-grants uses only tests for backticks or asterisk after the ON statement but PROXY GRANTS use single quotes.

example:
asterisk: GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;
backticks: GRANT ALL PRIVILEGES ON `test`.* TO 'root'@'127.0.0.1';

This is the GRANT statement that breaks pt-show-grants using --revoke and or --separate because it uses single quotes
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION;

with --revoke
Use of uninitialized value $grants in concatenation (.) or string at /usr/bin/pt-show-grants line 1767.
with --separate
Use of uninitialized value $grants in split at /usr/bin/pt-show-grants line 1718.

Thanks,
 William