diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilder.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilder.java index 35b742671646f..eaaaee9c05e51 100644 --- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilder.java +++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilder.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.encrypt.rewrite.token; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.infra.rewrite.sql.token.common.generator.aware.DatabaseAware; import org.apache.shardingsphere.encrypt.rewrite.aware.EncryptConditionsAware; import org.apache.shardingsphere.encrypt.rewrite.condition.EncryptCondition; import org.apache.shardingsphere.encrypt.rewrite.token.generator.assignment.EncryptInsertAssignmentTokenGenerator; @@ -42,6 +41,7 @@ import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.rewrite.sql.token.common.generator.SQLTokenGenerator; +import org.apache.shardingsphere.infra.rewrite.sql.token.common.generator.aware.DatabaseAware; import org.apache.shardingsphere.infra.rewrite.sql.token.common.generator.builder.SQLTokenGeneratorBuilder; import java.util.Collection; diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/projection/EncryptProjectionTokenGenerator.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/projection/EncryptProjectionTokenGenerator.java index b21c0a186bee0..03bde3d645dd0 100644 --- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/projection/EncryptProjectionTokenGenerator.java +++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/projection/EncryptProjectionTokenGenerator.java @@ -68,8 +68,9 @@ public final class EncryptProjectionTokenGenerator { * @return generated SQL tokens */ public Collection generateSQLTokens(final SelectStatementContext selectStatementContext) { - Collection result = new LinkedList<>(generateSelectSQLTokens(selectStatementContext)); + Collection result = new LinkedList<>(); selectStatementContext.getSubqueryContexts().values().stream().map(this::generateSQLTokens).forEach(result::addAll); + result.addAll(generateSelectSQLTokens(selectStatementContext)); return result; }