Skip to content

DistSQL 'drop encrypt rule' does not take effect in real time #36886

@Yinogi

Description

@Yinogi

version:shardingsphere-proxy 5.5.2 docker
running with standalone mode,repository is MySQL 5.7

I create a encrypt rule and it works

MySQL [test]> CREATE ENCRYPT RULE test (
-> COLUMNS(
-> (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
-> ));
Query OK, 0 rows affected (0.43 sec)
MySQL [test]>
MySQL [test]>

and i can see it with 'show encrypt rules'

MySQL [test]> show encrypt rules;
+-------+--------------+---------------+-----------------------+-------------------+----------------+---------------------------------------------------------------+---------------------+----------------------+-----------------+------------------+
| table | logic_column | cipher_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props |
+-------+--------------+---------------+-----------------------+-------------------+----------------+---------------------------------------------------------------+---------------------+----------------------+-----------------+------------------+
| test | user_id | user_cipher | | | AES | {"aes-key-value":"123456abc","digest-algorithm-name":"SHA-1"} | | | | |
+-------+--------------+---------------+-----------------------+-------------------+----------------+---------------------------------------------------------------+---------------------+----------------------+-----------------+------------------+
1 row in set (0.25 sec)
MySQL [test]>
MySQL [test]>

and then i drop it,return OK,run 'show encrypt rules' return empty;

MySQL [test]> drop encrypt rule if exists test;
Query OK, 0 rows affected (0.05 sec)
MySQL [test]>
MySQL [test]> show encrypt rules;
Empty set (0.01 sec)
MySQL [test]>

but when i create a encrypt rule with the same rule name i just dropped,it failed and notice Duplicate encrypt rule names:

MySQL [test]> CREATE ENCRYPT RULE test (
-> COLUMNS(
-> (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
-> ));
ERROR 10204 (42S01): Duplicate encrypt rule names 'test' in database 'test'.
MySQL [test]>

i restart my proxy and create it again with the same DistSQL,then successfully created,it seems like 'drop encrypt rule' does not effect in real time,but this not happen in 'drop mask rule',is this a bug?how can i solve it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions