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

ASF GitHub Bot commented on CALCITE-2218:
-----------------------------------------

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

    https://github.com/apache/calcite-avatica/pull/32#discussion_r175318700
  
    --- Diff: 
core/src/main/java/org/apache/calcite/avatica/AvaticaResultSet.java ---
    @@ -398,15 +403,15 @@ public BigDecimal getBigDecimal(String columnLabel) 
throws SQLException {
       }
     
       public boolean isBeforeFirst() throws SQLException {
    -    return row < 0;
    --- End diff --
    
    if you go past the last row, spec says `getRow()` should return 0 too, 
which would trigger `isBeforeFirst()` to return true (which is wrong). Either 
`beforeFirst` is introduced, or then special logic is added to `getRow()` to 
return 0 if `afterLast` is `true` (but `row` field is not reset if `next()` 
returns false)


> AvaticaResultSet#getRow() is not 1-indexed based
> ------------------------------------------------
>
>                 Key: CALCITE-2218
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2218
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica
>            Reporter: Laurent Goujon
>            Assignee: Laurent Goujon
>            Priority: Major
>
> According to javadoc, {{ResultSet#getRow()}} is 1-indexed based, returning 0 
> when no result set



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

Reply via email to