You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zhuzhenting (via GitHub)" <gi...@apache.org> on 2023/02/06 15:00:09 UTC
[GitHub] [shardingsphere] zhuzhenting opened a new issue, #24033: [Encryption] The update operation does not overwrite encrypted fields
zhuzhenting opened a new issue, #24033:
URL: https://github.com/apache/shardingsphere/issues/24033
## Bug Report
### version
use encryption in my project, and the maven dependency:
```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>5.3.1</version>
</dependency>
```
### Expected behavior
when I execute a simple update SQL with mybatis-plus, plainColumn updated, but cipherColumn is still the old value, and the sql is:
``` sql
update user set phone = 'newRecord' where id = 1;
```
### Actual behavior
`phone` filed updated, but `phone_cipher` field is still the old value
### Steps to reproduce the behavior
this is my datasource configuration:
``` java
@Bean
public DataSource dataSource() {
Properties props = new Properties();
props.setProperty("aes-key-value", "k4YjA4OTM3NjkyNTlkYzY");
EncryptColumnRuleConfiguration phoneColumn = new EncryptColumnRuleConfiguration("phone", "phone_cipher", "", "", "phone", "aes_encryptor", false);
EncryptTableRuleConfiguration userTableRule = new EncryptTableRuleConfiguration("user", Arrays.asList(phoneColumn), false);
Map<String, AlgorithmConfiguration> encryptAlgorithmConfigs = new LinkedHashMap<>();
encryptAlgorithmConfigs.put("aes_encryptor", new AlgorithmConfiguration("AES", props));
EncryptRuleConfiguration encryptRuleConfig = new EncryptRuleConfiguration(Arrays.asList(userTableRule), encryptAlgorithmConfigs);
return ShardingSphereDataSourceFactory.createDataSource(createDataSource(),
}
```
MySQL table structure
```sql
create table user{
id int primary;
phone varchar(255) not null;
phone_cipher varchar(255);
}
```
--
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] zhuzhenting closed issue #24033: [Encryption] The update operation does not overwrite encrypted fields
Posted by "zhuzhenting (via GitHub)" <gi...@apache.org>.
zhuzhenting closed issue #24033: [Encryption] The update operation does not overwrite encrypted fields
URL: https://github.com/apache/shardingsphere/issues/24033
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org