Shadow

Syntax

  1. SHOW SHADOW shadowRule | RULES [FROM databaseName]
  2. SHOW SHADOW TABLE RULES [FROM databaseName]
  3. SHOW SHADOW ALGORITHMS [FROM databaseName]
  4. shadowRule:
  5. RULE ruleName
  • Support querying all shadow rules and specified table query
  • Support querying all shadow table rules
  • Support querying all shadow algorithms

Return Value Description

Shadow Rule

ColumnDescription
rule_nameRule name
source_nameSource database
shadow_nameShadow database
shadow_tableShadow table

Shadow Table Rule

ColumnDescription
shadow_tableShadow table
shadow_algorithm_nameShadow algorithm name

Shadow Algorithms

ColumnDescription
shadow_algorithm_nameShadow algorithm name
typeShadow algorithm type
propsShadow algorithm properties
is_defaultDefault

Shadow Rule status

ColumnDescription
statusEnable

Example

SHOW SHADOW RULES

  1. mysql> SHOW SHADOW RULES;
  2. +--------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +--------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. | shadow_rule_2 | ds_2 | ds_shadow_2 | t_order_item |
  7. +--------------------+-------------+-------------+--------------+
  8. 2 rows in set (0.02 sec)

SHOW SHADOW RULE ruleName

  1. mysql> SHOW SHADOW RULE shadow_rule_1;
  2. +------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. +------------------+-------------+-------------+--------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW TABLE RULES

  1. mysql> SHOW SHADOW TABLE RULES;
  2. +--------------+--------------------------------------------------------------------------------+
  3. | shadow_table | shadow_algorithm_name |
  4. +--------------+--------------------------------------------------------------------------------+
  5. | t_order_1 | user_id_match_algorithm,simple_hint_algorithm_1 |
  6. +--------------+--------------------------------------------------------------------------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW ALGORITHMS

  1. mysql> SHOW SHADOW ALGORITHMS;
  2. +-------------------------+--------------------+-------------------------------------------+----------------+
  3. | shadow_algorithm_name | type | props | is_default |
  4. +-------------------------+--------------------+-------------------------------------------+----------------+
  5. | user_id_match_algorithm | REGEX_MATCH | operation=insert,column=user_id,regex=[1] | false |
  6. | simple_hint_algorithm_1 | SIMPLE_HINT | shadow=true,foo=bar | false |
  7. +-------------------------+--------------------+-------------------------------------------+----------------+
  8. 2 rows in set (0.01 sec)