yx9o opened a new issue #11723: URL: https://github.com/apache/shardingsphere/issues/11723
Hi, community, I added a test case for `SchemaPrivilegeBuilder`, and found that the scenario of `when using user1 login from any other host, you can use database test and db_dal_admin` is currently not supported. `user-schema-mappings: root@localhost=test, [email protected]=db_dal_admin, user1@=test, user1@=test1` ```java @Test public void assertFindPrivileges() { SchemaPrivilegesPermittedAuthorityProviderAlgorithm algorithm = new SchemaPrivilegesPermittedAuthorityProviderAlgorithm(); Properties properties = new Properties(); properties.setProperty(PROP_USER_SCHEMA_MAPPINGS, "root@localhost=test, [email protected]=db_dal_admin, user1@=test, user1@=test1"); algorithm.setProps(properties); algorithm.init(Collections.emptyMap(), Collections.singletonList(new ShardingSphereUser("user1", "", "127.0.0.2"))); Optional<ShardingSpherePrivileges> privileges = algorithm.findPrivileges(new Grantee("user1", "127.0.0.2")); assertTrue(privileges.isPresent()); assertTrue(privileges.get().hasPrivileges("test")); } ``` ### Which version of ShardingSphere did you use? master branch ### Expected behavior `assertTrue(privileges.get().hasPrivileges("test"));` Can get the test, the verification is passed. ### Actual behavior `assertTrue(privileges.get().hasPrivileges("test"));` The test cannot be obtained, and the verification fails. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
