X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3D39753BF1 for ; Thu, 21 Apr 2005 18:42:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01570-05 for ; Thu, 21 Apr 2005 21:38:45 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id C0F8153BCC for ; Thu, 21 Apr 2005 18:10:08 -0300 (ADT) Received: (qmail 19696 invoked by uid 0); 21 Apr 2005 21:10:09 -0000 Received: from 84.163.187.113 by www66.gmx.net with HTTP; Thu, 21 Apr 2005 23:10:09 +0200 (MEST) Date: Thu, 21 Apr 2005 23:10:09 +0200 (MEST) From: "Ruediger Herrmann" To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Subject: isLast() and empty ResultSet X-Priority: 3 (Normal) X-Authenticated: #1351255 Message-ID: <6626.1114117809@www66.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/118 X-Sequence-Number: 12725 Hello, I implemented an Iterator interface iterating over a ResultSet. Therefore I rely on isLast() to implement the Iterator#hasNext() method. This works fine unless the whole ResultSet is empty. For empty RresultSets, isLast always returns true. Stepping through the code I found the reason therefore. Line 544 of AbstractJdbc2ResultSet says if (rows_size == 0) return false; // No rows. At least to me this is suspicious as I would return the opposite. Might that be a bug or is there any other reason to behave like this? I am using JDBC Driver 8.0 Build 311 and Server Version 8.0.2. Regards Rüdiger -- +++ NEU: GMX DSL_Flatrate! Schon ab 14,99 EUR/Monat! +++ GMX Garantie: Surfen ohne Tempo-Limit! http://www.gmx.net/de/go/dsl