[CONJ-527] resultset.last() return wrong value if resultset has only one result Created: 2017-09-19  Updated: 2020-08-25  Resolved: 2017-09-21

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC 4.2 compatibility
Affects Version/s: 2.1.0, 2.1.1, 1.6.4
Fix Version/s: 1.6.5, 2.1.2

Type: Bug Priority: Critical
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-13781 Max(sequence) returns zero Closed

 Description   

Using resultset.last(), when resultset has one row, last() position correctly cursor set on last row, but return the "false" value. In this case, "true" value is expected.

JDBC javadoc

true if the cursor is on a valid row; false if there are no rows in the result set

Other positionning/verification methods (like isBeforeFirst(), isAfterLast(), isFirst(), isLast(), first(), absolute(row), relative(row), previous(), next()) return correct result.



 Comments   
Comment by Diego Dupin [ 2017-09-21 ]

Correction committed, available using maven SNAPSHOT's (2.1.2-SNAPSHOT / 1.5.6-SNAPSHOT) :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>2.1.2-SNAPSHOT</version>
    </dependency>
</dependencies>

Generated at Thu Feb 08 03:16:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.