policy_references
You can view the application information of the Masking Policy and Row Access Policy by querying the view policy_references.
The following fields are provided in policy_references:
| Field | Description |
|---|---|
| POLICY_DATABASE | The database to which the policy belongs. |
| POLICY_NAME | The name of the policy. |
| POLICY_TYPE | The type of the policy, including Column Masking and Row Access. |
| REF_CATALOG | The catalog of the table to which the policy is applied. |
| REF_DATABASE | The database of the table to which the policy is applied. |
| REF_OBJECT_NAME | The name of the table to which the policy is applied. |
| REF_COLUMN | The name of the column to which the policy is applied. |
Example:
MySQL > SELECT * FROM sys.policy_references\G
*************************** 1. row ***************************
POLICY_DATABASE: db_test
POLICY_NAME: phone_mask
POLICY_TYPE: Column Masking
REF_CATALOG: default_catalog
REF_DATABASE: db_test
REF_OBJECT_NAME: sales_info
REF_COLUMN: phone
*************************** 2. row ***************************
POLICY_DATABASE: db_test
POLICY_NAME: region_data
POLICY_TYPE: Row Access
REF_CATALOG: default_catalog
REF_DATABASE: db_test
REF_OBJECT_NAME: sales_info
REF_COLUMN: NULL