MySQL 9.7 Reference Manual Including MySQL NDB Cluster 9.7

15.7.7.11 SHOW CREATE MASKING POLICY Statement

    SHOW CREATE MASKING POLICY policy_name;      
    

SHOW CREATE MASKING POLICY shows the statement that created the named masking policy. To use this statement, you must have the MANAGE_DATA_MASKING_POLICY privilege, and the object_policy component must be loaded. The named policy must exist. If either condition is not met, an error is returned.

The statement prints the policy name and argument name using the lettercase specified when the policy was created.

mysql> SHOW CREATE MASKING POLICY mask_password\G
*************************** 1. row ***************************
           Masking Policy: mask_password
Create Masking Policy: CREATE MASKING POLICY `mask_password`(`pass_column`)
    CASE WHEN CURRENT_ROLE_IN('admin')
         THEN `pass_column`
         ELSE SHA2(`pass_column`, 256)
    END