You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ra...@apache.org on 2017/04/10 17:29:52 UTC

phoenix git commit: PHOENIX-3776 Implement setDate in PhoenixCalcitePreparedStatement to pass java.sql.Date as java.util.Date till PHOENIX-868 is fixed(Rajeshbabu)-addendum

Repository: phoenix
Updated Branches:
  refs/heads/calcite 6fee45d6c -> a78e008b0


PHOENIX-3776 Implement setDate in PhoenixCalcitePreparedStatement to pass java.sql.Date as java.util.Date till PHOENIX-868 is fixed(Rajeshbabu)-addendum


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a78e008b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a78e008b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a78e008b

Branch: refs/heads/calcite
Commit: a78e008b0f993b0663d6835df2ee88cf6d7f8711
Parents: 6fee45d
Author: Rajeshbabu Chintaguntla <ra...@apache.org>
Authored: Mon Apr 10 22:59:21 2017 +0530
Committer: Rajeshbabu Chintaguntla <ra...@apache.org>
Committed: Mon Apr 10 22:59:21 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a78e008b/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java b/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java
index c79b34f..d087d62 100644
--- a/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java
+++ b/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java
@@ -528,7 +528,11 @@ public class PhoenixCalciteFactory extends CalciteFactory {
 
         @Override
         public void setDate(int parameterIndex, Date x) throws SQLException {
-            getSite(parameterIndex).setObject(new java.util.Date(x.getTime()));
+            if(x == null) {
+                super.setDate(parameterIndex, x);
+            } else {
+                getSite(parameterIndex).setObject(new java.util.Date(x.getTime()));
+            }
         }
     }