RE: [HACKERS] Bug in cursors??

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: <chris(at)bitmead(dot)com>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Bug in cursors??
Date: 2000-02-08 08:44:32
Message-ID: 000301bf7210$b84f2120$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: owner-pgsql-hackers(at)postgreSQL(dot)org
> [mailto:owner-pgsql-hackers(at)postgreSQL(dot)org]On Behalf Of Chris Bitmead
>
> Hi all,
>
> I came across this comment in exec_append_initialize_next....
>
> /* ----------------
> * initialize the scan
> * (and update the range table appropriately)
> * (doesn't this leave the range table hosed for
> anybody upstream
> * of the Append node??? - jolly )
> * ----------------
> */
>
> I took a stab at guessing what this might mean, and ran the following
> test.
> It looks like a bug. Can anybody shed any light on whether the above
> comment is likely to relate to this bug, and is there anybody who is
> so intimate with this code that they are willing to fix it?
>

I've forgotten to apply the following patch.
Without the patch,backward sequential scan is impossible
after reaching EOF.
It may be one of the cause.

Regards.

*** access/heap/heapam.c.orig Mon Aug 2 14:56:36 1999
--- access/heap/heapam.c Tue Nov 9 12:59:48 1999
***************
*** 775,782 ****
if (scan->rs_ptup.t_data == scan->rs_ctup.t_data &&
BufferIsInvalid(scan->rs_pbuf))
{
- if (BufferIsValid(scan->rs_nbuf))
- ReleaseBuffer(scan->rs_nbuf);
return NULL;
}

--- 775,780 ----
***************
*** 833,842 ****
ReleaseBuffer(scan->rs_pbuf);
scan->rs_ptup.t_data = NULL;
scan->rs_pbuf = InvalidBuffer;
- if (BufferIsValid(scan->rs_nbuf))
- ReleaseBuffer(scan->rs_nbuf);
- scan->rs_ntup.t_data = NULL;
- scan->rs_nbuf = InvalidBuffer;
return NULL;
}

--- 831,836 ----
***************
*** 855,862 ****
if (scan->rs_ctup.t_data == scan->rs_ntup.t_data &&
BufferIsInvalid(scan->rs_nbuf))
{
- if (BufferIsValid(scan->rs_pbuf))
- ReleaseBuffer(scan->rs_pbuf);
HEAPDEBUG_3; /* heap_getnext returns NULL at end */
return NULL;
}
--- 849,854 ----
***************
*** 915,924 ****
ReleaseBuffer(scan->rs_nbuf);
scan->rs_ntup.t_data = NULL;
scan->rs_nbuf = InvalidBuffer;
- if (BufferIsValid(scan->rs_pbuf))
- ReleaseBuffer(scan->rs_pbuf);
- scan->rs_ptup.t_data = NULL;
- scan->rs_pbuf = InvalidBuffer;
HEAPDEBUG_6; /* heap_getnext returning EOS */
return NULL;
}
--- 907,912 ----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Mount 2000-02-08 08:57:56 Inserting large objects
Previous Message Tom Lane 2000-02-08 08:24:10 Re: [HACKERS] TODO item