strongduanmu commented on a change in pull request #14006:
URL: https://github.com/apache/shardingsphere/pull/14006#discussion_r766266660
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptProjectionTokenGenerator.java
##########
@@ -143,8 +155,8 @@ private ColumnProjection buildColumnProjection(final
ColumnProjectionSegment seg
return result;
}
- private Collection<ColumnProjection> generateProjections(final String
tableName, final ColumnProjection column, final SubqueryType subqueryType,
final boolean shorthand) {
- Collection<ColumnProjection> result = new LinkedList<>();
+ private List<ColumnProjection> generateProjections(final String tableName,
final ColumnProjection column, final SubqueryType subqueryType, final boolean
shorthand) {
+ List<ColumnProjection> result = new LinkedList<>();
Review comment:
@cheese8 Please use Collection and Iterator to get first element.
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptProjectionTokenGenerator.java
##########
@@ -118,6 +119,17 @@ private SubstitutableColumnNameToken
generateSQLTokens(final ShorthandProjection
return new SubstitutableColumnNameToken(segment.getStartIndex(),
segment.getStopIndex(), projections, databaseType.getQuoteCharacter());
}
+ private void processWithFirstColumnProjection(final
ColumnProjectionSegment columnSegment, final List<ColumnProjection>
projections) {
Review comment:
@cheese8 Why add this special logic? Can you consider handling similar
logic inside generateProjections?
##########
File path:
shardingsphere-test/shardingsphere-rewrite-test/src/test/resources/scenario/encrypt/case/select_for_query_with_cipher.xml
##########
@@ -109,7 +109,22 @@
<output sql="SELECT u.cipher_amount AS amount, u.cipher_password AS
password, o.cipher_certificate_number AS certificate_number FROM (SELECT
cipher_certificate_number, assisted_query_certificate_number,
plain_certificate_number FROM t_account_bak) o, t_account u WHERE
o.assisted_query_certificate_number=u.assisted_query_certificate_number AND
u.assisted_query_password=?" parameters="assisted_query_1" />
</rewrite-assertion>
- <rewrite-assertion
id="select_not_nested_subquery_in_table_segment_with_shorthand_project"
db-types="MySQL">
+ <rewrite-assertion id="select_not_nested_subquery_in_table_segment2"
db-types="MySQL">
Review comment:
@cheese8 Can we give him a more meaningful name? Instead of ending with
1, 2.
--
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]