RaigorJiang opened a new pull request, #19337:
URL: https://github.com/apache/shardingsphere/pull/19337
Revise #18179.
### Before
```sql
mysql> SHOW ENCRYPT RULES;
ERROR 1997 (C1997): Runtime exception: [null]
mysql> CREATE ENCRYPT RULE t_encrypt (
-> COLUMNS(
->
(NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME=AES,PROPERTIES('aes-key-value'='123456abc'))),
-> (NAME=order_id, CIPHER =order_cipher,TYPE(NAME=MD5))
-> ),QUERY_WITH_CIPHER_COLUMN=true
-> );
ERROR 1997 (C1997): Runtime exception: [Cannot invoke
"org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment.getName()"
because the return value of
"org.apache.shardingsphere.encrypt.distsql.parser.segment.EncryptColumnSegment.getAssistedQueryEncryptor()"
is null]
```
##### Log
```sql
java.lang.IllegalStateException: null
at
com.google.common.base.Preconditions.checkState(Preconditions.java:492)
at
org.apache.shardingsphere.encrypt.distsql.handler.query.EncryptRuleQueryResultSet.init(EncryptRuleQueryResultSet.java:51)
at
org.apache.shardingsphere.proxy.backend.text.distsql.rql.RQLBackendHandler.execute(RQLBackendHandler.java:51)
at
org.apache.shardingsphere.proxy.backend.text.distsql.rql.RQLBackendHandler.execute(RQLBackendHandler.java:40)
java.lang.NullPointerException: Cannot invoke
"org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment.getName()"
because the return value of
"org.apache.shardingsphere.encrypt.distsql.parser.segment.EncryptColumnSegment.getAssistedQueryEncryptor()"
is null
at
org.apache.shardingsphere.encrypt.distsql.handler.converter.EncryptRuleStatementConverter.createAssistedQueryEncryptorConfiguration(EncryptRuleStatementConverter.java:80)
at
org.apache.shardingsphere.encrypt.distsql.handler.converter.EncryptRuleStatementConverter.createEncryptorConfigurations(EncryptRuleStatementConverter.java:70)
at
org.apache.shardingsphere.encrypt.distsql.handler.converter.EncryptRuleStatementConverter.convert(EncryptRuleStatementConverter.java:48)
```
### After
<img width="1236" alt="Snipaste_2022-07-18_23-40-24"
src="https://user-images.githubusercontent.com/5668787/179559625-6347f1b4-8a42-4244-84ff-f3e40205b316.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]