We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.3.2
shardingsphere-jdbc-core
different phone with diferent like query column encrypt value
some different phone with the same like query column encrypt value, for example: phone_encrypt |display_name |like_query_phone|phone_encrypt |display_name |like_query_phone| ------------------------+------------------+----------------+------------------------+--------------------+----------------+ +PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|苍溪县李斯高粱酒坊 |08850144551 | +PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|黎平县鸿鹏氧气销售有限责任公司 |08850144551 | +PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|苍溪县李斯高粱酒坊 |08850144551 | +PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|黎平县鸿鹏氧气销售有限责任公司 |08850144551 |
sql is just simple “batch insert into xxx” for already existed data, and like query column uses CHAR_DIGEST_LIKE algrithm.
java code: AlgorithmConfiguration likeEncryptor = new AlgorithmConfiguration("CHAR_DIGEST_LIKE", props); encryptors.put(LIKE_ENCRYPTOR_NAME, likeEncryptor);
new EncryptColumnRuleConfiguration( xxxx,xxx,xxxx....., LIKE_ENCRYPTOR_NAME,.....)
sql code: phone_encrypt varchar(64) DEFAULT NULL COMMENT '加密手机号', assisted_query_phone varchar(64) DEFAULT NULL COMMENT '加密手机号查询辅助列', like_query_phone varchar(64) DEFAULT NULL COMMENT '加密手机号模糊查询辅助列',
phone_encrypt
assisted_query_phone
like_query_phone
mybatis code : INSERT INTO user_new ( ) VALUES ( #{item.id,jdbcType=BIGINT}, #{item.userName,jdbcType=VARCHAR}, #{item.realName,jdbcType=VARCHAR}, #{item.displayName,jdbcType=VARCHAR}, #{item.displayCode,jdbcType=VARCHAR}, #{item.phone,jdbcType=VARCHAR}, xxxxxxx
user_new
The text was updated successfully, but these errors were encountered:
Hi @jumanjihu, can you format your code and mysql result with markdown, it's hard to read the issue now.
Sorry, something went wrong.
No branches or pull requests
Which version of ShardingSphere did you use?
5.3.2
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
shardingsphere-jdbc-core
Expected behavior
different phone with diferent like query column encrypt value
Actual behavior
some different phone with the same like query column encrypt value, for example:
phone_encrypt |display_name |like_query_phone|phone_encrypt |display_name |like_query_phone|
------------------------+------------------+----------------+------------------------+--------------------+----------------+
+PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|苍溪县李斯高粱酒坊 |08850144551 |
+PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|黎平县鸿鹏氧气销售有限责任公司 |08850144551 |
+PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|苍溪县李斯高粱酒坊 |08850144551 |
+PLjCCgZ4PA67YBhZotDfg==|正三 |08850144551 |gZv1/40nUfiXHaEX6WHepg==|黎平县鸿鹏氧气销售有限责任公司 |08850144551 |
Reason analyze (If you can)
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
sql is just simple “batch insert into xxx” for already existed data, and like query column uses CHAR_DIGEST_LIKE algrithm.
Example codes for reproduce this issue (such as a github link).
java code:
AlgorithmConfiguration likeEncryptor = new AlgorithmConfiguration("CHAR_DIGEST_LIKE", props);
encryptors.put(LIKE_ENCRYPTOR_NAME, likeEncryptor);
new EncryptColumnRuleConfiguration( xxxx,xxx,xxxx....., LIKE_ENCRYPTOR_NAME,.....)
sql code:
phone_encrypt
varchar(64) DEFAULT NULL COMMENT '加密手机号',assisted_query_phone
varchar(64) DEFAULT NULL COMMENT '加密手机号查询辅助列',like_query_phone
varchar(64) DEFAULT NULL COMMENT '加密手机号模糊查询辅助列',mybatis code :
INSERT INTO
user_new
()
VALUES
(
#{item.id,jdbcType=BIGINT},
#{item.userName,jdbcType=VARCHAR},
#{item.realName,jdbcType=VARCHAR},
#{item.displayName,jdbcType=VARCHAR},
#{item.displayCode,jdbcType=VARCHAR},
#{item.phone,jdbcType=VARCHAR},
xxxxxxx
The text was updated successfully, but these errors were encountered: