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 2020/06/16 11:12:36 UTC

[GitHub] [shardingsphere] tristaZero commented on a change in pull request #5985: fix(encrypt): Fixed issues#5979

tristaZero commented on a change in pull request #5985:
URL: https://github.com/apache/shardingsphere/pull/5985#discussion_r440770837



##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-rewrite/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptInsertValuesTokenGenerator.java
##########
@@ -133,7 +133,8 @@ private void encryptToken(final InsertValue insertValueToken, final String table
     private void addPlainColumn(final InsertValue insertValueToken, final int columnIndex,
                                 final String tableName, final String columnName, final InsertValueContext insertValueContext, final Object originalValue) {
         if (getEncryptRule().findPlainColumn(tableName, columnName).isPresent()) {
-            DerivedSimpleExpressionSegment derivedExpressionSegment = insertValueContext.getParameters().isEmpty()
+            DerivedSimpleExpressionSegment derivedExpressionSegment = (insertValueContext.getParameters().isEmpty()
+                    || insertValueContext.getValueExpressions().get(columnIndex) instanceof LiteralExpressionSegment)

Review comment:
       Hi, These codes appear twice, do you think it is better to exact a function for them?




----------------------------------------------------------------
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