gufengwyx8 commented on a change in pull request #3276: Add table owner for 
logic encrypt column
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3276#discussion_r335260140
 
 

 ##########
 File path: 
sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/encrypt/EncryptCondition.java
 ##########
 @@ -56,18 +58,20 @@
     
     private final Map<Integer, Object> positionValueMap = new 
LinkedHashMap<>();
     
-    public EncryptCondition(final String columnName, final String tableName, 
final int startIndex, final int stopIndex, final ExpressionSegment 
expressionSegment) {
+    public EncryptCondition(final String columnName, final String tableName, 
final String tableOwner, final int startIndex, final int stopIndex, final 
ExpressionSegment expressionSegment) {
         this.columnName = columnName;
         this.tableName = tableName;
+        this.tableOwner = tableOwner;
         this.startIndex = startIndex;
         this.stopIndex = stopIndex;
         operator = ShardingOperator.EQUAL;
         putPositionMap(0, expressionSegment);
     }
     
-    public EncryptCondition(final String columnName, final String tableName, 
final int startIndex, final int stopIndex, final List<ExpressionSegment> 
expressionSegments) {
 
 Review comment:
   Actually the variable `tableOwner` and `tableAlias` have the same meaning, I 
can rename `tableOwner` to `tableAlias`.  But if I change the logic as you 
said, 
   the SQL
   `select * from table where pwd = 1` 
   will be rewritten as 
   `select * from table where table.cipher  = xxx`
   This result SQL is right?

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


With regards,
Apache Git Services

Reply via email to