forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
privileges: use UPPER case for privileges in SHOW GRANT (pingcap#26360)
- Loading branch information
Showing
4 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,7 +509,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
// NOTICE: this is not compatible with MySQL! (MySQL would report user1@localhost also for 127.0.0.1) | ||
cli.checkRows(c, rows, "[email protected]") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT Select ON test.* TO 'user1'@'%'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT SELECT ON test.* TO 'user1'@'%'") | ||
}) | ||
// Test with unix domain socket file connection with all hosts | ||
cli.runTests(c, func(config *mysql.Config) { | ||
|
@@ -522,7 +522,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT Select ON test.* TO 'user1'@'%'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT SELECT ON test.* TO 'user1'@'%'") | ||
}) | ||
|
||
// Setup [email protected] for loop back network interface access | ||
|
@@ -549,7 +549,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
// NOTICE: this is not compatible with MySQL! (MySQL would report user1@localhost also for 127.0.0.1) | ||
cli.checkRows(c, rows, "[email protected]") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'127.0.0.1'\nGRANT Select,Insert ON test.* TO 'user1'@'127.0.0.1'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'127.0.0.1'\nGRANT SELECT,INSERT ON test.* TO 'user1'@'127.0.0.1'") | ||
}) | ||
// Test with unix domain socket file connection with all hosts | ||
cli.runTests(c, func(config *mysql.Config) { | ||
|
@@ -562,7 +562,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT Select ON test.* TO 'user1'@'%'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT SELECT ON test.* TO 'user1'@'%'") | ||
}) | ||
|
||
// Setup user1@localhost for socket (and if MySQL compatible; loop back network interface access) | ||
|
@@ -590,7 +590,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
// NOTICE: this is not compatible with MySQL! (MySQL would report user1@localhost also for 127.0.0.1) | ||
cli.checkRows(c, rows, "[email protected]") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'127.0.0.1'\nGRANT Select,Insert ON test.* TO 'user1'@'127.0.0.1'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'127.0.0.1'\nGRANT SELECT,INSERT ON test.* TO 'user1'@'127.0.0.1'") | ||
}) | ||
// Test with unix domain socket file connection with all hosts | ||
cli.runTests(c, func(config *mysql.Config) { | ||
|
@@ -603,7 +603,7 @@ func (ts *tidbTestSuite) TestSocketAndIp(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'localhost'\nGRANT Select,Insert,Update,Delete ON test.* TO 'user1'@'localhost'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'localhost'\nGRANT SELECT,INSERT,UPDATE,DELETE ON test.* TO 'user1'@'localhost'") | ||
}) | ||
|
||
} | ||
|
@@ -683,7 +683,7 @@ func (ts *tidbTestSuite) TestOnlySocket(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT Select ON test.* TO 'user1'@'%'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT SELECT ON test.* TO 'user1'@'%'") | ||
}) | ||
|
||
// Setup [email protected] for loop back network interface access | ||
|
@@ -713,7 +713,7 @@ func (ts *tidbTestSuite) TestOnlySocket(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT Select ON test.* TO 'user1'@'%'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'%'\nGRANT SELECT ON test.* TO 'user1'@'%'") | ||
}) | ||
|
||
// Setup user1@localhost for socket (and if MySQL compatible; loop back network interface access) | ||
|
@@ -742,7 +742,7 @@ func (ts *tidbTestSuite) TestOnlySocket(c *C) { | |
rows := dbt.mustQuery("select user()") | ||
cli.checkRows(c, rows, "user1@localhost") | ||
rows = dbt.mustQuery("show grants") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'localhost'\nGRANT Select,Insert,Update,Delete ON test.* TO 'user1'@'localhost'") | ||
cli.checkRows(c, rows, "GRANT USAGE ON *.* TO 'user1'@'localhost'\nGRANT SELECT,INSERT,UPDATE,DELETE ON test.* TO 'user1'@'localhost'") | ||
}) | ||
|
||
} | ||
|