xiyelife commented on a change in pull request #3295: fixed for #3234 and add
the encrypted test case for more than four cipher coloumns
URL:
https://github.com/apache/incubator-shardingsphere/pull/3295#discussion_r335788763
##########
File path:
sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/encrypt/parameter/impl/EncryptInsertValueParameterRewriter.java
##########
@@ -57,10 +60,14 @@ public void rewrite(final ParameterBuilder
parameterBuilder, final SQLStatementC
if (!encryptTable.isPresent()) {
return;
}
- for (String each : encryptTable.get().getLogicColumns()) {
- Optional<ShardingEncryptor> shardingEncryptor =
encryptRule.findShardingEncryptor(tableName, each);
+ Optional<InsertColumnsSegment> insertColumnsSegment =
sqlStatementContext.getSqlStatement().findSQLSegment(InsertColumnsSegment.class);
+ if (!insertColumnsSegment.isPresent()) {
+ return;
+ }
+ for (ColumnSegment each : insertColumnsSegment.get().getColumns()) {
Review comment:
Yes, I also forget add the test cases for insert without columns。
my purpose is:
in order to use the original order in SQL to rerwite cipher SQL, rather than
using the column order in the configured encryption rules, otherwise it will
also cause the parameters to be disordered.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services