You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/12/19 08:56:03 UTC
[GitHub] [incubator-shardingsphere] xiyelife opened a new issue #3770:
Insert miss the plain columns in the final sql.
xiyelife opened a new issue #3770: Insert miss the plain columns in the final sql.
URL: https://github.com/apache/incubator-shardingsphere/issues/3770
### Which version of ShardingSphere did you use?
4.0.0-RC4-SNAPSHOT
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
sharding-jdbc
### Expected behavior
the encrypt rule config plain column the same to logic column can insert plain column to the db
### Actual behavior
It can not insert the plain to the db
### Reason analyze (If you can)
org.apache.shardingsphere.sql.rewriter.encrypt.token.generator.impl.AssistQueryAndPlainInsertColumnsTokenGenerator#getColumns
![image](https://user-images.githubusercontent.com/8772975/71158965-d2243280-227f-11ea-8775-bec584488673.png)
this code cause the plain column can not be the same to the logic column
rule config like this , the final sql will do not contains the plain columns!
encryptRule:
tables:
t_account_bak:
columns:
**password**:
cipherColumn: cipher_password
assistedQueryColumn: assisted_query_password
**plainColumn: password**
encryptor: assisted_query
encryptors:
normal:
type: NORMAL_ENCRYPT
assisted_query:
type: ASSISTED_QUERY_ENCRYPT
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
### Example codes for reproduce this issue (such as a github link).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] xiyelife commented on issue #3770:
Insert miss the plain columns in the final sql.
Posted by GitBox <gi...@apache.org>.
xiyelife commented on issue #3770: Insert miss the plain columns in the final sql.
URL: https://github.com/apache/incubator-shardingsphere/issues/3770#issuecomment-569921090
after Revert PR#3663 , it work well in 4.0.0-RC4-SNAPSHOT.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] xiyelife commented on issue #3770:
Insert miss the plain columns in the final sql.
Posted by GitBox <gi...@apache.org>.
xiyelife commented on issue #3770: Insert miss the plain columns in the final sql.
URL: https://github.com/apache/incubator-shardingsphere/issues/3770#issuecomment-567855870
use encryptor of official like this:
```
encryptors:
aes_encryptor:
props:
aes.key.value: 123456abc
type: aes
tables:
user_info:
columns:
name:
cipherColumn: name_enc
encryptor: aes_encryptor
plainColumn: name
mobile:
cipherColumn: mobile_enc
encryptor: aes_encryptor
plainColumn: mobile
ident:
cipherColumn: ident_enc
encryptor: aes_encryptor
plainColumn: ident
value:
cipherColumn: value_enc
encryptor: aes_encryptor
plainColumn: value
2019-12-20 17:22:00.640 INFO 2980 --- [ main] o.a.s.core.util.ConfigurationLogger : Properties
sql.show: 'true'
query.with.cipher.column: 'false'
```
The actual sql is the same as above .
```
ShardingSphere-SQL : SQL: insert into user_info (cust_id, unique_id, name_enc,
ident_enc, mobile_enc, password,
reg_time, modify_time, reg_source,
reg_app_channel, reg_device_info, status,
is_mobile_authed, complate_cust_info, time_inst,
time_upd, has_checked)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, now(), ?, ?)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] xiyelife closed issue #3770: Insert miss
the plain columns in the final sql.
Posted by GitBox <gi...@apache.org>.
xiyelife closed issue #3770: Insert miss the plain columns in the final sql.
URL: https://github.com/apache/incubator-shardingsphere/issues/3770
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services