[ 
https://issues.apache.org/jira/browse/PHOENIX-4864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16591303#comment-16591303
 ] 

ASF GitHub Bot commented on PHOENIX-4864:
-----------------------------------------

Github user karanmehta93 commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/336#discussion_r212550265
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixPreparedStatement.java
 ---
    @@ -45,7 +45,9 @@ public ResultSet executeQuery() throws SQLException {
     
         @Override
         public ResultSet getResultSet() throws SQLException {
    -        return new LoggingPhoenixResultSet(super.getResultSet(), 
phoenixMetricsLog, sql);
    +        ResultSet resultSet = super.getResultSet();
    +        return (resultSet == null) ? null : new 
LoggingPhoenixResultSet(super.getResultSet(),
    --- End diff --
    
    This is still a bug. `super.getResultSet()` call is not idempotent. You 
should replace this with `resultSet` local variable


> Fix NullPointerException while Logging some DDL Statements
> ----------------------------------------------------------
>
>                 Key: PHOENIX-4864
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4864
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Ashutosh Parekh
>            Priority: Minor
>
> We encounter a NullPointerException when ResultSet is null when some type of 
> DDL queries are executed. The following error is encountered.
> java.lang.NullPointerException: null
>  at 
> org.apache.phoenix.jdbc.LoggingPhoenixResultSet.close(LoggingPhoenixResultSet.java:40)
>  at 
> org.apache.calcite.avatica.jdbc.JdbcMeta$StatementExpiryHandler.onRemoval(JdbcMeta.java:1105)
>  at 
> com.google.common.cache.LocalCache.processPendingNotifications(LocalCache.java:1963)
> ...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to