Skip to content

Commit c40ee75

Browse files
author
James Cor
committed
revoke all tests
1 parent 4e9919a commit c40ee75

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

enginetest/queries/priv_auth_queries.go

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,11 @@ var UserPrivTests = []UserPrivilegeTest{
12381238
"CREATE TABLE test (pk BIGINT PRIMARY KEY);",
12391239
"INSERT INTO test VALUES (1), (2), (3);",
12401240
"CREATE USER tester@localhost;",
1241+
"CREATE USER tester1@localhost;",
1242+
"CREATE USER tester2@localhost;",
12411243
"GRANT ALL ON *.* TO tester@localhost;",
1244+
"GRANT ALL ON *.* TO tester1@localhost WITH GRANT OPTION;",
1245+
"GRANT ALL ON *.* TO tester2@localhost WITH GRANT OPTION;",
12421246
},
12431247
Assertions: []UserPrivilegeTestAssertion{
12441248
{
@@ -1280,8 +1284,46 @@ var UserPrivTests = []UserPrivilegeTest{
12801284
{
12811285
User: "root",
12821286
Host: "localhost",
1283-
Query: "SELECT User, Host, Select_priv, Insert_priv FROM mysql.user WHERE User = 'tester';",
1284-
Expected: []sql.Row{{"tester", "localhost", "N", "N"}},
1287+
Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester';",
1288+
Expected: []sql.Row{{"tester", "localhost", "N", "N", "N"}},
1289+
},
1290+
1291+
{
1292+
User: "root",
1293+
Host: "localhost",
1294+
Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester1';",
1295+
Expected: []sql.Row{{"tester1", "localhost", "Y", "Y", "Y"}},
1296+
},
1297+
{
1298+
User: "root",
1299+
Host: "localhost",
1300+
Query: "REVOKE ALL, GRANT OPTION FROM tester1@localhost;",
1301+
Expected: []sql.Row{{types.NewOkResult(0)}},
1302+
},
1303+
{
1304+
User: "root",
1305+
Host: "localhost",
1306+
Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester1';",
1307+
Expected: []sql.Row{{"tester1", "localhost", "N", "N", "N"}},
1308+
},
1309+
1310+
{
1311+
User: "root",
1312+
Host: "localhost",
1313+
Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';",
1314+
Expected: []sql.Row{{"tester2", "localhost", "Y", "Y", "Y"}},
1315+
},
1316+
{
1317+
User: "root",
1318+
Host: "localhost",
1319+
Query: "REVOKE ALL PRIVILEGES, GRANT OPTION FROM tester2@localhost;",
1320+
Expected: []sql.Row{{types.NewOkResult(0)}},
1321+
},
1322+
{
1323+
User: "root",
1324+
Host: "localhost",
1325+
Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';",
1326+
Expected: []sql.Row{{"tester2", "localhost", "N", "N", "N"}},
12851327
},
12861328
},
12871329
},

0 commit comments

Comments
 (0)