Skip to content

Commit dc57a59

Browse files
authored
Optimize algorithmDefinition naming in encryptColumnDefinition (#22494)
* Optimize algorithmDefinition naming in encryptColumnDefinition Signed-off-by: gxxiong <xionggaoxiang@foxmail.com> * fix it-Scaling error Signed-off-by: gxxiong <xionggaoxiang@foxmail.com> * fix it error Signed-off-by: gxxiong <xionggaoxiang@foxmail.com> * Rename definition on Encrypt Signed-off-by: gxxiong <xionggaoxiang@foxmail.com> * fix ci error Signed-off-by: gxxiong <xionggaoxiang@foxmail.com> Signed-off-by: gxxiong <xionggaoxiang@foxmail.com>
1 parent 2bca973 commit dc57a59

File tree

14 files changed

+115
-53
lines changed

14 files changed

+115
-53
lines changed

features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/Keyword.g4

+20-8
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,19 @@ ENCRYPT
5858
TYPE
5959
: T Y P E
6060
;
61-
61+
62+
ENCRYPT_ALGORITHM
63+
: E N C R Y P T UL_ A L G O R I T H M
64+
;
65+
66+
ASSISTED_QUERY_ALGORITHM
67+
: A S S I S T E D UL_ Q U E R Y UL_ A L G O R I T H M
68+
;
69+
70+
LIKE_QUERY_ALGORITHM
71+
: L I K E UL_ Q U E R Y UL_ A L G O R I T H M
72+
;
73+
6274
NAME
6375
: N A M E
6476
;
@@ -90,7 +102,7 @@ CIPHER
90102
PLAIN
91103
: P L A I N
92104
;
93-
105+
94106
ASSISTED_QUERY_COLUMN
95107
: A S S I S T E D UL_ Q U E R Y UL_ C O L U M N
96108
;
@@ -102,19 +114,19 @@ LIKE_QUERY_COLUMN
102114
QUERY_WITH_CIPHER_COLUMN
103115
: Q U E R Y UL_ W I T H UL_ C I P H E R UL_ C O L U M N
104116
;
105-
117+
106118
TRUE
107119
: T R U E
108120
;
109-
121+
110122
FALSE
111123
: F A L S E
112-
;
124+
;
113125

114126
DATA_TYPE
115127
: D A T A UL_ T Y P E
116128
;
117-
129+
118130
PLAIN_DATA_TYPE
119131
: P L A I N UL_ D A T A UL_ T Y P E
120132
;
@@ -131,10 +143,10 @@ LIKE_QUERY_DATA_TYPE
131143
: L I K E UL_ Q U E R Y UL_ D A T A UL_ T Y P E
132144
;
133145

134-
IF
146+
IF
135147
: I F
136148
;
137-
149+
138150
EXISTS
139151
: E X I S T S
140152
;

features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RDLStatement.g4

+15-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resourceName
4444
;
4545

4646
encryptColumnDefinition
47-
: LP columnDefinition (COMMA plainColumnDefinition)? COMMA cipherColumnDefinition (COMMA assistedQueryColumnDefinition)? (COMMA likeQueryColumnDefinition)? COMMA algorithmDefinition (COMMA algorithmDefinition)? (COMMA algorithmDefinition)? RP
47+
: LP columnDefinition (COMMA plainColumnDefinition)? COMMA cipherColumnDefinition (COMMA assistedQueryColumnDefinition)? (COMMA likeQueryColumnDefinition)? COMMA encryptAlgorithm (COMMA assistedQueryAlgorithm)? (COMMA likeQueryAlgorithm)? RP
4848
;
4949

5050
columnDefinition
@@ -56,7 +56,7 @@ columnName
5656
;
5757

5858
dataType
59-
: STRING
59+
: STRING
6060
;
6161

6262
plainColumnDefinition
@@ -90,7 +90,19 @@ likeQueryColumnDefinition
9090
likeQueryColumnName
9191
: IDENTIFIER
9292
;
93-
93+
94+
encryptAlgorithm
95+
: ENCRYPT_ALGORITHM LP algorithmDefinition RP
96+
;
97+
98+
assistedQueryAlgorithm
99+
: ASSISTED_QUERY_ALGORITHM LP algorithmDefinition RP
100+
;
101+
102+
likeQueryAlgorithm
103+
: LIKE_QUERY_ALGORITHM LP algorithmDefinition RP
104+
;
105+
94106
queryWithCipherColumn
95107
: TRUE | FALSE
96108
;

features/encrypt/distsql/parser/src/main/java/org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@
4545
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
4646
import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
4747

48-
import java.util.ArrayList;
49-
import java.util.List;
5048
import java.util.Objects;
51-
import java.util.Optional;
5249
import java.util.Properties;
5350
import java.util.stream.Collectors;
5451

@@ -88,10 +85,6 @@ public ASTNode visitEncryptRuleDefinition(final EncryptRuleDefinitionContext ctx
8885

8986
@Override
9087
public ASTNode visitEncryptColumnDefinition(final EncryptColumnDefinitionContext ctx) {
91-
List<AlgorithmSegment> algorithmSegments = new ArrayList<>();
92-
for (AlgorithmDefinitionContext each : ctx.algorithmDefinition()) {
93-
algorithmSegments.add((AlgorithmSegment) visit(each));
94-
}
9588
return new EncryptColumnSegment(getIdentifierValue(ctx.columnDefinition().columnName()),
9689
getIdentifierValue(ctx.cipherColumnDefinition().cipherColumnName()),
9790
null == ctx.plainColumnDefinition() ? null : getIdentifierValue(ctx.plainColumnDefinition().plainColumnName()),
@@ -102,11 +95,9 @@ public ASTNode visitEncryptColumnDefinition(final EncryptColumnDefinitionContext
10295
null == ctx.plainColumnDefinition() ? null : getIdentifierValue(ctx.plainColumnDefinition().dataType()),
10396
null == ctx.assistedQueryColumnDefinition() ? null : getIdentifierValue(ctx.assistedQueryColumnDefinition().dataType()),
10497
null == ctx.likeQueryColumnDefinition() ? null : getIdentifierValue(ctx.likeQueryColumnDefinition().dataType()),
105-
algorithmSegments.get(0),
106-
null == ctx.assistedQueryColumnDefinition() || 1 == algorithmSegments.size() ? null : algorithmSegments.get(1),
107-
null == ctx.likeQueryColumnDefinition() ? null
108-
: Optional.ofNullable(algorithmSegments).filter(algorithm -> algorithm.size() > 2).map(algorithm -> algorithm.get(2)).orElse(null));
109-
98+
null == ctx.encryptAlgorithm() ? null : (AlgorithmSegment) visit(ctx.encryptAlgorithm().algorithmDefinition()),
99+
null == ctx.assistedQueryAlgorithm() ? null : (AlgorithmSegment) visit(ctx.assistedQueryAlgorithm().algorithmDefinition()),
100+
null == ctx.likeQueryAlgorithm() ? null : (AlgorithmSegment) visit(ctx.likeQueryAlgorithm().algorithmDefinition()));
110101
}
111102

112103
@Override

features/encrypt/distsql/parser/src/test/java/org/apache/shardingsphere/encrypt/distsql/parser/EncryptDistSqlTest.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ public final class EncryptDistSqlTest {
4343
@Test
4444
public void assertCreateEncryptRule() {
4545
String sql = "CREATE ENCRYPT RULE t_encrypt (COLUMNS("
46-
+ " (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))"
47-
+ ",(NAME=order_id, CIPHER =order_cipher,TYPE(NAME='MD5')))"
46+
+ " (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=user_assisted,LIKE_QUERY_COLUMN=user_like"
47+
+ ",ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))"
48+
+ ",(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='MD5'))))"
4849
+ ",QUERY_WITH_CIPHER_COLUMN=true)";
4950
CreateEncryptRuleStatement createEncryptRuleStatement = (CreateEncryptRuleStatement) getEncryptDistSQLStatement(sql);
5051
assertThat(createEncryptRuleStatement.getRules().size(), is(1));
@@ -54,8 +55,10 @@ public void assertCreateEncryptRule() {
5455
@Test
5556
public void assertAlterEncryptRule() {
5657
String sql = "ALTER ENCRYPT RULE t_encrypt (COLUMNS("
57-
+ " (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),"
58-
+ " (NAME=order_id,CIPHER=order_cipher,TYPE(NAME='MD5'))), QUERY_WITH_CIPHER_COLUMN=TRUE)";
58+
+ " (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=user_assisted,LIKE_QUERY_COLUMN=user_like"
59+
+ ",ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))"
60+
+ ",(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='MD5'))))"
61+
+ ",QUERY_WITH_CIPHER_COLUMN=true)";
5962
AlterEncryptRuleStatement alterEncryptRule = (AlterEncryptRuleStatement) getEncryptDistSQLStatement(sql);
6063
assertThat(alterEncryptRule.getRules().size(), is(1));
6164
assertEncryptRule(alterEncryptRule.getRules().iterator().next());
@@ -70,7 +73,10 @@ private void assertEncryptRule(final EncryptRuleSegment encryptRuleSegment) {
7073
assertThat(userEncryptColumn.getName(), is("user_id"));
7174
assertThat(userEncryptColumn.getPlainColumn(), is("user_plain"));
7275
assertThat(userEncryptColumn.getCipherColumn(), is("user_cipher"));
76+
assertThat(userEncryptColumn.getAssistedQueryColumn(), is("user_assisted"));
7377
assertThat(userEncryptColumn.getEncryptor().getName(), is("AES"));
78+
assertThat(userEncryptColumn.getAssistedQueryEncryptor().getName(), is("MD5"));
79+
assertThat(userEncryptColumn.getLikeQueryEncryptor().getName(), is("CHAR_DIGEST_LIKE"));
7480
Properties props = new Properties();
7581
props.setProperty("aes-key-value", "123456abc");
7682
assertThat(userEncryptColumn.getEncryptor().getProps(), is(props));

proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/constant/DistSQLScriptConstants.java

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ public final class DistSQLScriptConstants {
164164

165165
public static final String CIPHER = "CIPHER=%s";
166166

167+
public static final String ASSISTED_QUERY_COLUMN = "ASSISTED_QUERY_COLUMN=%s";
168+
169+
public static final String LIKE_QUERY_COLUMN = "LIKE_QUERY_COLUMN=%s";
170+
171+
public static final String ENCRYPT_ALGORITHM = "ENCRYPT_ALGORITHM(%s)";
172+
173+
public static final String ASSISTED_QUERY_ALGORITHM = "ASSISTED_QUERY_ALGORITHM(%s)";
174+
175+
public static final String LIKE_QUERY_ALGORITHM = "LIKE_QUERY_ALGORITHM(%s)";
176+
167177
public static final String ALGORITHM_TYPE = "TYPE(NAME='%s', PROPERTIES(%s))";
168178

169179
public static final String ALGORITHM_TYPE_WITHOUT_PROPS = "TYPE(NAME='%s')";

proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandler.java

+27-3
Original file line numberDiff line numberDiff line change
@@ -453,16 +453,15 @@ private String getEncryptColumns(final Collection<EncryptColumnRuleConfiguration
453453
Iterator<EncryptColumnRuleConfiguration> iterator = ruleConfigs.iterator();
454454
while (iterator.hasNext()) {
455455
EncryptColumnRuleConfiguration columnRuleConfig = iterator.next();
456-
String columnType = getAlgorithmType(encryptors.get(columnRuleConfig.getEncryptorName()));
457-
result.append(String.format(DistSQLScriptConstants.ENCRYPT_COLUMN, columnRuleConfig.getLogicColumn(), getColumnPlainAndCipher(columnRuleConfig), columnType));
456+
result.append(String.format(DistSQLScriptConstants.ENCRYPT_COLUMN, columnRuleConfig.getLogicColumn(), getColumns(columnRuleConfig), getEncryptAlgorithms(columnRuleConfig, encryptors)));
458457
if (iterator.hasNext()) {
459458
result.append(DistSQLScriptConstants.COMMA).append(System.lineSeparator());
460459
}
461460
}
462461
return result.toString();
463462
}
464463

465-
private String getColumnPlainAndCipher(final EncryptColumnRuleConfiguration ruleConfig) {
464+
private String getColumns(final EncryptColumnRuleConfiguration ruleConfig) {
466465
StringBuilder result = new StringBuilder();
467466
String plainColumnName = ruleConfig.getPlainColumn();
468467
String cipherColumnName = ruleConfig.getCipherColumn();
@@ -475,6 +474,31 @@ private String getColumnPlainAndCipher(final EncryptColumnRuleConfiguration rule
475474
}
476475
result.append(String.format(DistSQLScriptConstants.CIPHER, cipherColumnName));
477476
}
477+
if (null != ruleConfig.getAssistedQueryColumn()) {
478+
result.append(DistSQLScriptConstants.COMMA).append(" ").append(String.format(DistSQLScriptConstants.ASSISTED_QUERY_COLUMN, ruleConfig.getAssistedQueryColumn()));
479+
}
480+
if (null != ruleConfig.getLikeQueryColumn()) {
481+
result.append(DistSQLScriptConstants.COMMA).append(" ").append(String.format(DistSQLScriptConstants.LIKE_QUERY_COLUMN, ruleConfig.getLikeQueryColumn()));
482+
}
483+
return result.toString();
484+
}
485+
486+
private String getEncryptAlgorithms(final EncryptColumnRuleConfiguration ruleConfig, final Map<String, AlgorithmConfiguration> encryptors) {
487+
StringBuilder result = new StringBuilder();
488+
String cipherEncryptorName = ruleConfig.getEncryptorName();
489+
String assistedQueryEncryptorName = ruleConfig.getAssistedQueryEncryptorName();
490+
String likeQueryEncryptorName = ruleConfig.getLikeQueryEncryptorName();
491+
if (null != cipherEncryptorName) {
492+
result.append(String.format(DistSQLScriptConstants.ENCRYPT_ALGORITHM, getAlgorithmType(encryptors.get(cipherEncryptorName))));
493+
}
494+
if (null != assistedQueryEncryptorName) {
495+
result.append(DistSQLScriptConstants.COMMA).append(" ")
496+
.append(String.format(DistSQLScriptConstants.ASSISTED_QUERY_ALGORITHM, getAlgorithmType(encryptors.get(assistedQueryEncryptorName))));
497+
}
498+
if (null != likeQueryEncryptorName) {
499+
result.append(DistSQLScriptConstants.COMMA).append(" ")
500+
.append(String.format(DistSQLScriptConstants.LIKE_QUERY_ALGORITHM, getAlgorithmType(encryptors.get(likeQueryEncryptorName))));
501+
}
478502
return result.toString();
479503
}
480504

proxy/backend/src/test/resources/conf/convert/config-encrypt.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,19 @@ rules:
4747
aes-key-value: 123456abc
4848
md5_encryptor:
4949
type: MD5
50+
like_encryptor:
51+
type: CHAR_DIGEST_LIKE
5052
tables:
5153
t_encrypt:
5254
columns:
5355
user_id:
5456
plainColumn: user_plain
5557
cipherColumn: user_cipher
5658
encryptorName: aes_encryptor
59+
assistedQueryColumn: user_assisted
60+
assistedQueryEncryptorName: md5_encryptor
61+
likeQueryColumn: user_like
62+
likeQueryEncryptorName: like_encryptor
5763
order_id:
5864
cipherColumn: order_cipher
5965
encryptorName: md5_encryptor

proxy/backend/src/test/resources/conf/convert/config-mix.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,19 @@ rules:
146146
aes-key-value: 123456abc
147147
md5_encryptor:
148148
type: MD5
149+
like_encryptor:
150+
type: CHAR_DIGEST_LIKE
149151
tables:
150152
t_encrypt:
151153
columns:
152154
user_id:
153155
plainColumn: user_plain
154156
cipherColumn: user_cipher
155157
encryptorName: aes_encryptor
158+
assistedQueryColumn: user_assisted
159+
assistedQueryEncryptorName: md5_encryptor
160+
likeQueryColumn: user_like
161+
likeQueryEncryptorName: like_encryptor
156162
order_id:
157163
cipherColumn: order_cipher
158164
encryptorName: md5_encryptor

proxy/backend/src/test/resources/expected/convert-encrypt.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifet
3131

3232
CREATE ENCRYPT RULE t_encrypt (
3333
COLUMNS(
34-
(NAME=user_id, PLAIN=user_plain, CIPHER=user_cipher, TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))),
35-
(NAME=order_id, CIPHER=order_cipher, TYPE(NAME='md5'))
34+
(NAME=user_id, PLAIN=user_plain, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='md5')), LIKE_QUERY_ALGORITHM(TYPE(NAME='char_digest_like'))),
35+
(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='md5')))
3636
),QUERY_WITH_CIPHER_COLUMN=true);

proxy/backend/src/test/resources/expected/convert-mix.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ WRITE_DATA_SOURCE_QUERY_ENABLED=true
6969

7070
CREATE ENCRYPT RULE t_encrypt (
7171
COLUMNS(
72-
(NAME=user_id, PLAIN=user_plain, CIPHER=user_cipher, TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))),
73-
(NAME=order_id, CIPHER=order_cipher, TYPE(NAME='md5'))
72+
(NAME=user_id, PLAIN=user_plain, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='md5')), LIKE_QUERY_ALGORITHM(TYPE(NAME='char_digest_like'))),
73+
(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='md5')))
7474
),QUERY_WITH_CIPHER_COLUMN=true);
7575

7676
CREATE SHARDING TABLE RULE t_order (

test/integration-test/scaling/src/test/resources/env/common/migration-command.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
<create-target-order-table-encrypt-rule>
6161
CREATE ENCRYPT RULE t_order (
62-
COLUMNS((NAME=status, CIPHER=status,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),
62+
COLUMNS((NAME=status, CIPHER=status,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))),
6363
QUERY_WITH_CIPHER_COLUMN=true)
6464
</create-target-order-table-encrypt-rule>
6565

test/integration-test/test-suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@
6969
<assertion-sql sql="SHOW BROADCAST TABLE RULES;" />
7070
</assertion>
7171
</test-case>
72-
<test-case sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),QUERY_WITH_CIPHER_COLUMN=true);" db-types="MySQL, PostgreSQL">
72+
<test-case sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))),QUERY_WITH_CIPHER_COLUMN=true);" db-types="MySQL, PostgreSQL">
7373
<assertion expected-data-file="create_encrypt_rule.xml">
7474
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
7575
<destroy-sql sql="DROP ENCRYPT RULE t_user " />
7676
</assertion>
7777
</test-case>
78-
<test-case sql="ALTER ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abcd')))),QUERY_WITH_CIPHER_COLUMN=true);" db-types="MySQL, PostgreSQL">
78+
<test-case sql="ALTER ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abcd'))))),QUERY_WITH_CIPHER_COLUMN=true);" db-types="MySQL, PostgreSQL">
7979
<assertion expected-data-file="alter_encrypt_rule.xml">
80-
<initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),QUERY_WITH_CIPHER_COLUMN=true);" />
80+
<initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))),QUERY_WITH_CIPHER_COLUMN=true);" />
8181
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
8282
<destroy-sql sql="DROP ENCRYPT RULE t_user " />
8383
</assertion>
8484
</test-case>
8585
<test-case sql="DROP ENCRYPT RULE t_user;" db-types="MySQL, PostgreSQL">
8686
<assertion expected-data-file="drop_encrypt_rule.xml">
87-
<initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),QUERY_WITH_CIPHER_COLUMN=true);" />
87+
<initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,PLAIN=pwd_plain,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))),QUERY_WITH_CIPHER_COLUMN=true);" />
8888
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
8989
</assertion>
9090
</test-case>

0 commit comments

Comments
 (0)