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 f6fb343b46777..f1b23f9ed65ea 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 @@ -204,10 +204,10 @@ private ColumnProjection buildColumnProjection(final ColumnProjectionSegment seg private Collection generateProjections(final EncryptColumn encryptColumn, final ColumnProjection columnProjection, final SubqueryType subqueryType, final boolean newAddedColumn) { - if (null == subqueryType || SubqueryType.PROJECTION == subqueryType || SubqueryType.WITH == subqueryType) { + if (null == subqueryType || SubqueryType.PROJECTION == subqueryType) { return Collections.singleton(generateProjection(encryptColumn, columnProjection)); } - if (SubqueryType.TABLE == subqueryType || SubqueryType.JOIN == subqueryType) { + if (SubqueryType.TABLE == subqueryType || SubqueryType.JOIN == subqueryType || SubqueryType.WITH == subqueryType) { return generateProjectionsInTableSegmentSubquery(encryptColumn, columnProjection, newAddedColumn); } if (SubqueryType.PREDICATE == subqueryType) {