Encrypt jdbc bug occur when cipher column value is not from method parameter.
1.Below cases work normally.
UPDATE t_demo SET username = CONCAT('xxx','xxxx') WHERE id in (#{id1},#{id2},#{id3})
UPDATE t_demo SET username = ‘xxx’ WHERE id in (#{id1},#{id2},#{id3})
UPDATE t_demo SET username = #{username} WHERE id in (#{id1},#{id2},#{id3})
2.But in these cases, exception occurs. Using encrypt-jdbc, and username is one of encrypt column.
create t_demo{
id int,
username varchar(20),
username_encrypt(64)
};
UPDATE t_demo SET username = CONCAT(username,'xxx') WHERE id in (#{id1},#{id2},#{id3})
UPDATE t_demo SET username = CONCAT(username,'xxx',UNIX_TIMESTAMP()) WHERE id in (#{id1},#{id2},#{id3})
UPDATE t_demo SET username = CONCAT(username,UNIX_TIMESTAMP()) WHERE id in (#{id1},#{id2},#{id3})
UPDATE t_demo SET username = username WHERE id in (#{id1},#{id2},#{id3})
encrypt rule configuration: spring.shardingsphere.datasource.name = ds spring.shardingsphere.datasource.ds.type = com.alibaba.druid.pool.DruidDataSource spring.shardingsphere.datasource.ds.driver-class-name = com.mysql.jdbc.Driver spring.shardingsphere.datasource.ds.url = xxx spring.shardingsphere.datasource.ds.username = xxx spring.shardingsphere.datasource.ds.password = xxx spring.shardingsphere.encrypt.encryptors.encryptor_aes.type = AES spring.shardingsphere.encrypt.encryptors.encryptor_aes.props.aes.key.value = spring.shardingsphere.encrypt.tables.t_demo.columns.username.plainColumn = username spring.shardingsphere.encrypt.tables.t_demo.columns.username.cipherColumn = username_encrypt spring.shardingsphere.encrypt.tables.t_demo.columns.username.encryptor = encryptor_aes
All Update SQL throw exception.
3.Here is one of the rewrite SQL:
update t_demo set username = ?, username_encrypt = ? where resourceid in (?,?,?)

4.Version sharding-sphere 4.0.0-RC2
5.Personal view The exception throw might because the plain column's value is from MySQL but not method parameters, and encrypt jdbc can not get the cipher column value in core. It may cause this exception. In my opinion, encrypt jdbc can just omit this cipher column, but not throws an exception, or It is maybe exist a better way to handle with it.
Can you describe the summary in title for search friendly?
What' mean of core parameter?
I saw your SQL
update seewo_sys_users set username = ?, username_encrypt = ? where resourceid in (?,?,?)
what is the table seewo_sys_users, what is different with previous table t_demo?
Will close soon if no response anymore
- It is method parameter.
- Not seewo_sys_users,It is t_demo.
What is your encrypt rule configuration?
Can you fix the title about core parameter?
Hi, will close soon if no response anymore
Hi, maybe you can try my sql. But note to this:

I have 2 suggestions, maybe you can have try:
- Version 4.0.0-RC3 is released, some of encrypt bugs are fixed, you can try to this version
- If the issue still existed, please provide the log of
sql.show.
Another suggestion is could you use code to instead of screenshot? Screenshot cannot search by other people.
The new Version fixed this bugs.