You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/12/25 08:25:46 UTC

[GitHub] [incubator-shardingsphere] yanyzy opened a new pull request #3802: [Shadow] add more code to make the feature more complete

yanyzy opened a new pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802
 
 
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802#discussion_r361282303
 
 

 ##########
 File path: sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/shadow/SimpleJudgementEngine.java
 ##########
 @@ -59,10 +58,7 @@ public boolean isShadowSql() {
                 return false;
             }
             List<Object> values = shadowCondition.get().getValues(Collections.emptyList());
-            for (Map.Entry<Integer, Integer> entry : shadowCondition.get().getPositionIndexMap().entrySet()) {
-                Object value = values.get(entry.getValue());
-                return value instanceof Boolean && (Boolean) value;
-            }
+            return "TRUE".equals(((String) values.get(0)).toUpperCase());
 
 Review comment:
   Does `value.get(0)` return null ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802#discussion_r361282713
 
 

 ##########
 File path: sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/shadow/SimpleJudgementEngine.java
 ##########
 @@ -74,7 +70,7 @@ private boolean judgeShadowSqlForInsert(final InsertValueContext insertValueCont
             if (shadowRule.getColumn().equals(columnName)) {
                 int columnIndex = insertSQLStatementContext.getColumnNames().indexOf(columnName);
                 Object value = insertValueContext.getValue(columnIndex);
-                return value instanceof Boolean && (Boolean) value;
+                return "TRUE".equals(((String) value).toUpperCase());
 
 Review comment:
   εŒδΈŠγ€‚

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] yanyzy commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete

Posted by GitBox <gi...@apache.org>.
yanyzy commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802#discussion_r361293130
 
 

 ##########
 File path: sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/shadow/SimpleJudgementEngine.java
 ##########
 @@ -74,7 +70,7 @@ private boolean judgeShadowSqlForInsert(final InsertValueContext insertValueCont
             if (shadowRule.getColumn().equals(columnName)) {
                 int columnIndex = insertSQLStatementContext.getColumnNames().indexOf(columnName);
                 Object value = insertValueContext.getValue(columnIndex);
-                return value instanceof Boolean && (Boolean) value;
+                return "TRUE".equals(((String) value).toUpperCase());
 
 Review comment:
   I think use column index to get value should not be null, or it will throw runtime exception.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu merged pull request #3802: [Shadow] add more code to make the feature more complete

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] yanyzy commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete

Posted by GitBox <gi...@apache.org>.
yanyzy commented on a change in pull request #3802: [Shadow] add more code to make the feature more complete
URL: https://github.com/apache/incubator-shardingsphere/pull/3802#discussion_r361292470
 
 

 ##########
 File path: sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/shadow/SimpleJudgementEngine.java
 ##########
 @@ -59,10 +58,7 @@ public boolean isShadowSql() {
                 return false;
             }
             List<Object> values = shadowCondition.get().getValues(Collections.emptyList());
-            for (Map.Entry<Integer, Integer> entry : shadowCondition.get().getPositionIndexMap().entrySet()) {
-                Object value = values.get(entry.getValue());
-                return value instanceof Boolean && (Boolean) value;
-            }
+            return "TRUE".equals(((String) values.get(0)).toUpperCase());
 
 Review comment:
   I will add a judgement for it, thanks

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services