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


##########
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:
   As I see we create a copy in applyInputDisplacement 



-- 
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]

Reply via email to