RaigorJiang opened a new issue #13912:
URL: https://github.com/apache/shardingsphere/issues/13912
### Which version of ShardingSphere did you use?
5.0.0
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSPhere-Proxy
### Expected behavior
Users cannot query data from schemas without privileges.
### Actual behavior
Users can query data from schemas without privileges.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
#### 1. Authority Configuration
```yaml
- !AUTHORITY
users:
- root@:root
- user1@:user1
- [email protected]:user1
provider:
type: SCHEMA_PRIVILEGES_PERMITTED
props:
user-schema-mappings: root@=test, [email protected]=db_dal_admin,
user1@=test, user1@=db_dal_admin
```
The above configuration refers to PR : #10998
#### 2. Login With `user1`
```sql
# login
mysql -h 127.0.0.1 -P 3307 -u user1 -p
# create database
mysql> create database db_dal_admin;
# use database
use db_dal_admin;
# create table t_single
CREATE TABLE `t_single` (
`order_id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`status` varchar(50) DEFAULT NULL,
PRIMARY KEY (`order_id`)
);
# show tables
mysql> show tables;
+------------------------+------------+
| Tables_in_db_dal_admin | Table_type |
+------------------------+------------+
| t_single | BASE TABLE |
+------------------------+------------+
1 row in set (0.00 sec)
```
#### 3. Login With `root`
```sql
# login
mysql -h 127.0.0.1 -P 3307 -u root -p
# create database
create database test;
# show databases;
mysql> show databases;
+-------------+
| schema_name |
+-------------+
| test |
+-------------+
1 row in set (0.00 sec)
# use database
mysql> use test;
Database changed
# use schema `dal_db_admin`
mysql> use dal_db_admin;
ERROR 1049 (42000): Unknown database 'dal_db_admin'
# but can select from `dal_db_admin`
mysql> select * from db_dal_admin.t_single;
Empty set (0.01 sec)
```
--
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]