Bug in cursors?? - Mailing list pgsql-hackers

From Chris Bitmead
Subject Bug in cursors??
Date
Msg-id 389FAFF6.44B7F6ED@nimrod.itg.telecom.com.au
Whole thread Raw
Responses RE: [HACKERS] Bug in cursors??  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
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?

# Comment: b and c inherit from a. d inherits from b.
chrisb=# begin work;
BEGIN
chrisb=# select aa from a;aa 
----
(0 rows)

chrisb=# select aa from b;aa  
-----ppp
(1 row)

chrisb=# select aa from c; aa   
-------cmore
(1 row)

chrisb=# select aa from d; aa   
-------dmore
(1 row)

chrisb=# select aa from a*; aa   
-------pppcmoredmore
(3 rows)

chrisb=# declare cu cursor for select aa from a*;
SELECT
chrisb=# fetch forward 1 in cu;aa  
-----ppp
(1 row)

chrisb=# fetch forward 1 in cu; aa   
-------cmore
(1 row)

chrisb=# fetch backward 1 in cu;aa 
----
(0 rows)


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] TODO item
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Regression tests...