SHOW-POLICY
Name
SHOW ROW POLICY
Description
View the row security policy under the current DB
1. SHOW ROW POLICY [FOR user]
Example
- view all security policies.
1. mysql> SHOW ROW POLICY;
2. +-------------------+----------------------+-----------+------+-------------+-------------------+------+-------------------------------------------------------------------------------------------------------------------------------------------+
3. | PolicyName | DbName | TableName | Type | FilterType | WherePredicate | User | OriginStmt |
4. +-------------------+----------------------+-----------+------+-------------+-------------------+------+-------------------------------------------------------------------------------------------------------------------------------------------+
5. | test_row_policy_1 | default_cluster:test | table1 | ROW | RESTRICTIVE | `id` IN (1, 2) | root | /* ApplicationName=DataGrip 2021.3.4 */ CREATE ROW POLICY test_row_policy_1 ON test.table1 AS RESTRICTIVE TO root USING (id in (1, 2));
6. |
7. | test_row_policy_2 | default_cluster:test | table1 | ROW | RESTRICTIVE | `col1` = 'col1_1' | root | /* ApplicationName=DataGrip 2021.3.4 */ CREATE ROW POLICY test_row_policy_2 ON test.table1 AS RESTRICTIVE TO root USING (col1='col1_1');
8. |
9. +-------------------+----------------------+-----------+------+-------------+-------------------+------+-------------------------------------------------------------------------------------------------------------------------------------------+
10. 2 rows in set (0.00 sec)
2. specify user name query
1. mysql> SHOW ROW POLICY FOR test;
2. +-------------------+----------------------+-----------+------+------------+-------------------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
3. | PolicyName | DbName | TableName | Type | FilterType | WherePredicate | User | OriginStmt |
4. +-------------------+----------------------+-----------+------+------------+-------------------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
5. | test_row_policy_3 | default_cluster:test | table1 | ROW | PERMISSIVE | `col1` = 'col1_2' | default_cluster:test | /* ApplicationName=DataGrip 2021.3.4 */ CREATE ROW POLICY test_row_policy_3 ON test.table1 AS PERMISSIVE TO test USING (col1='col1_2');
6. |
7. +-------------------+----------------------+-----------+------+------------+-------------------+----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
8. 1 row in set (0.01 sec)
3. demonstrate data migration strategies
1. mysql> SHOW STORAGE POLICY;
2. +---------------------+---------+-----------------------+---------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3. | PolicyName | Type | StorageResource | CooldownDatetime | CooldownTtl | properties |
4. +---------------------+---------+-----------------------+---------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
5. | showPolicy_1_policy | STORAGE | showPolicy_1_resource | 2022-06-08 00:00:00 | -1 | {
6. "AWS_SECRET_KEY": "******",
7. "AWS_REGION": "bj",
8. "AWS_ACCESS_KEY": "bbba",
9. "AWS_MAX_CONNECTIONS": "50",
10. "AWS_CONNECTION_TIMEOUT_MS": "1000",
11. "type": "s3",
12. "AWS_ROOT_PATH": "path/to/rootaaaa",
13. "AWS_BUCKET": "test-bucket",
14. "AWS_ENDPOINT": "bj.s3.comaaaa",
15. "AWS_REQUEST_TIMEOUT_MS": "3000"
16. } |
17. +---------------------+---------+-----------------------+---------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
18. 1 row in set (0.00 sec)
Keywords
1. SHOW, POLICY
