RE: [HACKERS] Bug in cursors??

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема RE: [HACKERS] Bug in cursors??
Дата
Msg-id 000301bf7210$b84f2120$2801007e@tpf.co.jp
обсуждение исходный текст
Ответ на Bug in cursors??  (Chris Bitmead <chrisb@nimrod.itg.telstra.com.au>)
Ответы Re: [HACKERS] Bug in cursors??  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
> -----Original Message-----
> From: owner-pgsql-hackers@postgreSQL.org
> [mailto:owner-pgsql-hackers@postgreSQL.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 ----


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] New Globe
Следующее
От: Peter Mount
Дата:
Сообщение: Inserting large objects