stoty commented on code in PR #1567:
URL: https://github.com/apache/phoenix/pull/1567#discussion_r1122626049


##########
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java:
##########
@@ -440,6 +445,19 @@ public void setNull(int parameterIndex, int sqlType, 
String typeName) throws SQL
 
     @Override
     public void setObject(int parameterIndex, Object o) throws SQLException {
+        if (o instanceof java.util.Date) {
+            //TODO add java.time when implemented
+            if (connection.isCompliantTimezoneHandling()) {
+                if (o instanceof java.sql.Timestamp) {
+                    o = DateUtil.applyInputDisplacement((java.sql.Timestamp)o);
+                } else if (o instanceof java.sql.Time) {
+                    o = DateUtil.applyInputDisplacement((java.sql.Time)o);
+                } else if (o instanceof java.sql.Date) {
+                    o = DateUtil.applyInputDisplacement((java.sql.Date)o);
+                }
+            }
+            //FIXME if we make a copy in setDate() from temporals, why not 
here ?

Review Comment:
   Yes, that comment was meant for the old code path, where we don't apply the 
displacement.
   
   I think that we never modify the objects passed as parameters anyway, but at 
some point we should check if that's true, and either remove the copying from 
the other methods, or do it for all mutable parameters.



-- 
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: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to