You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2015/03/11 03:33:51 UTC

phoenix git commit: PHOENIX-1577 addendum - fix bug in resultSet.getTimeStamp(int colIndex, Calendar cal) too

Repository: phoenix
Updated Branches:
  refs/heads/master dee6f9d38 -> 80a50c964


PHOENIX-1577 addendum - fix bug in  resultSet.getTimeStamp(int colIndex, Calendar cal) too


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

Branch: refs/heads/master
Commit: 80a50c964e94608c263471c1eca0c81e44ea5b19
Parents: dee6f9d
Author: Samarth <sa...@salesforce.com>
Authored: Tue Mar 10 15:48:59 2015 -0700
Committer: Samarth <sa...@salesforce.com>
Committed: Tue Mar 10 19:33:36 2015 -0700

----------------------------------------------------------------------
 .../apache/phoenix/end2end/TimezoneOffsetFunctionIT.java  |  3 +++
 .../java/org/apache/phoenix/jdbc/PhoenixResultSet.java    | 10 +---------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/80a50c96/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
index 96142ed..6ff6357 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
@@ -179,6 +179,9 @@ public class TimezoneOffsetFunctionIT extends BaseHBaseManagedTimeIT {
         ResultSet rs = conn.createStatement().executeQuery(query);
         rs.next();
         assertEquals(new Timestamp(time), rs.getTimestamp(1));
+        assertEquals(new Timestamp(time), rs.getTimestamp("V"));
+        assertEquals(new Timestamp(time), rs.getTimestamp(1, cal));
+        assertEquals(new Timestamp(time), rs.getTimestamp("V", cal));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/80a50c96/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
index 7d91dbb..49e384c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
@@ -652,15 +652,7 @@ public class PhoenixResultSet implements ResultSet, SQLCloseable, org.apache.pho
 
     @Override
     public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
-        checkCursorState();
-        Timestamp value = (Timestamp)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
-            PTimestamp.INSTANCE, ptr);
-        wasNull = (value == null);
-        if (value == null) {
-            return null;
-        }
-        cal.setTime(value); //this resets the millisecond part of timestamp according to the time zone of the calendar.
-        return DateUtil.getTimestamp(cal.getTimeInMillis(), value.getNanos());
+        return getTimestamp(columnIndex);
     }
 
     @Override