Simplified split_grants() and added a test for mixed table & column grants on the same table

This commit is contained in:
Brian Fraser
2012-11-01 06:15:54 -03:00
parent 0fd9239500
commit a5a23665fe
3 changed files with 23 additions and 12 deletions

View File

@@ -128,6 +128,17 @@ ok(
"Column-level grants --separate --revoke (bug 866075)"
);
diag(`/tmp/12345/use -u root -e "GRANT SELECT ON sakila.city TO 'sally'\@'%'"`);
ok(
no_diff(
sub { pt_show_grants::main('-F', $cnf, qw(--only sally --no-header)) },
"t/pt-show-grants/samples/column-grants-combined.txt",
stderr => 1,
),
"Column-level grants combined with table-level grants on the same table (bug 866075)"
);
diag(`/tmp/12345/use -u root -e "DROP USER 'sally'\@'%'"`);
# #############################################################################

View File

@@ -0,0 +1,4 @@
-- Grants for 'sally'@'%'
GRANT INSERT (city), SELECT, SELECT (city_id) ON `sakila`.`city` TO 'sally'@'%';
GRANT SELECT (SANumber, DateCreated, PaymentStat, PckPrice) ON `test`.`t` TO 'sally'@'%';
GRANT USAGE ON *.* TO 'sally'@'%';