Skip to content

Commit 2de39b2

Browse files
committed
Fix TestAccGrantComplexMySQL8 to grant correct dynamic privileges
The test was checking for CONNECTION_ADMIN and FIREWALL_EXEMPT privileges, but the configuration was only granting SELECT and UPDATE. This mismatch caused the test to fail with "grant CONNECTION_ADMIN not found". MySQL 8.0+ dynamic privileges like CONNECTION_ADMIN and FIREWALL_EXEMPT must be granted globally (database = "*"), not on specific databases. Updated the test configuration to: - Grant CONNECTION_ADMIN and FIREWALL_EXEMPT (instead of SELECT, UPDATE) - Use database = "*" for global privileges (instead of specific database)
1 parent c3a98f1 commit 2de39b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mysql/resource_grant_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,8 @@ resource "mysql_user" "test" {
904904
resource "mysql_grant" "test" {
905905
user = "${mysql_user.test.user}"
906906
host = "${mysql_user.test.host}"
907-
database = "${mysql_database.test.name}"
908-
privileges = ["SELECT", "UPDATE"]
907+
database = "*"
908+
privileges = ["CONNECTION_ADMIN", "FIREWALL_EXEMPT"]
909909
}
910910
`, dbName, dbName)
911911
}

0 commit comments

Comments
 (0)