SHOW MASK RULES

Description

The SHOW MASK RULES syntax is used to query mask rules for specified database.

Syntax

Grammar Railroad diagram

  1. ShowMaskRule::=
  2. 'SHOW' 'MASK' ('RULES' | 'RULE' ruleName) ('FROM' databaseName)?
  3. ruleName ::=
  4. identifier
  5. databaseName ::=
  6. identifier

Supplement

  • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.

Return value description

ColumnDescription
tableTable name
columnColumn name
algorithm_typeMask algorithm type
algorithm_propsMask algorithm properties

Example

  • Query mask rules for specified database
  1. SHOW MASK RULES FROM mask_db;
  1. mysql> SHOW MASK RULES FROM mask_db;
  2. +---------+----------+------------------+--------------------------------+
  3. | table | column | algorithm_type | algorithm_props |
  4. +---------+----------+------------------+--------------------------------+
  5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  6. | t_mask | address | MD5 | |
  7. | t_order | order_id | MD5 | |
  8. | t_user | user_id | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  9. +---------+----------+------------------+--------------------------------+
  10. 4 rows in set (0.01 sec)
  • Query mask rules for current database
  1. SHOW MASK RULES;
  1. mysql> SHOW MASK RULES;
  2. +---------+----------+------------------+--------------------------------+
  3. | table | column | algorithm_type | algorithm_props |
  4. +---------+----------+------------------+--------------------------------+
  5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  6. | t_mask | address | MD5 | |
  7. | t_order | order_id | MD5 | |
  8. | t_user | user_id | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  9. +---------+----------+------------------+--------------------------------+
  10. 4 rows in set (0.01 sec)
  • Query specified mask rule for specified database
  1. SHOW MASK RULE t_mask FROM mask_db;
  1. mysql> SHOW MASK RULE t_mask FROM mask_db;
  2. +--------+--------------+------------------+--------------------------------+
  3. | table | logic_column | mask_algorithm | props |
  4. +--------+--------------+------------------+--------------------------------+
  5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  6. | t_mask | address | MD5 | |
  7. +--------+--------------+------------------+--------------------------------+
  8. 2 rows in set (0.00 sec)
  • Query specified mask rule for current database
  1. SHOW MASK RULE t_mask;
  1. mysql> SHOW MASK RULE t_mask;
  2. +--------+--------------+------------------+--------------------------------+
  3. | table | logic_column | mask_algorithm | props |
  4. +--------+--------------+------------------+--------------------------------+
  5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
  6. | t_mask | address | MD5 | |
  7. +--------+--------------+------------------+--------------------------------+
  8. 2 rows in set (0.00 sec)

Reserved word

SHOW, MASK, RULE, RULES, FROM