terrymanu commented on a change in pull request #15725:
URL: https://github.com/apache/shardingsphere/pull/15725#discussion_r821759012



##########
File path: 
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptProjectionTokenGenerator.java
##########
@@ -77,41 +85,96 @@ public boolean isGenerateSQLToken(final 
SQLStatementContext<?> sqlStatementConte
     
     private void addGenerateSQLTokens(final 
Collection<SubstitutableColumnNameToken> result, final SelectStatementContext 
selectStatementContext) {
         Map<String, String> columnTableNames = 
getColumnTableNames(selectStatementContext);
+        int countPlaceHolders = 0;
         for (ProjectionSegment projection : 
selectStatementContext.getSqlStatement().getProjections().getProjections()) {
             SubqueryType subqueryType = 
selectStatementContext.getSubqueryType();
             if (projection instanceof ColumnProjectionSegment) {
                 ColumnProjectionSegment columnSegment = 
(ColumnProjectionSegment) projection;
                 ColumnProjection columnProjection = 
buildColumnProjection(columnSegment);
                 String tableName = 
columnTableNames.get(columnProjection.getExpression());
                 if (null != tableName && 
encryptRule.findEncryptColumn(tableName, 
columnProjection.getName()).isPresent()) {
-                    result.add(generateSQLToken(tableName, columnSegment, 
columnProjection, subqueryType));
+                    result.add(generateSQLToken(tableName, columnSegment, 
columnProjection, subqueryType, Optional.empty()));
                 }
             }
+            if (projection instanceof ExpressionProjectionSegment) {
+                Tuple2<Collection<SubstitutableColumnNameToken>, Integer> 
tuple2 = generateSQLToken(((ExpressionProjectionSegment) projection).getExpr(), 
columnTableNames, subqueryType, 

Review comment:
       Is it necessary to use Groovy's lib here?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to