Обсуждение: Re: [BUGS] bug in postgresql-v6.4 on FreeBSD

Поиск
Список
Период
Сортировка

Re: [BUGS] bug in postgresql-v6.4 on FreeBSD

От
Tatsuo Ishii
Дата:
>here is a bug which is reproducible on FreeBSD-2.2.6
>as well as on FreeBSD-2.2.7:
>
>
>nadia:mergl> echo -n "testing large objects using blob_read" >/tmp/gaga
>nadia:mergl> createdb pgtest
>nadia:mergl> psql pgtest
>...
>pgtest=> CREATE TABLE lobject ( id int4, loid oid );
>CREATE
>pgtest=> INSERT INTO lobject (id, loid) VALUES (1, lo_import('/tmp/gaga'));
>pqReadData() -- backend closed the channel unexpectedly.
>        This probably means the backend terminated abnormally before or while processing the request.
>We have lost the connection to the backend, so further processing is impossible.  Terminating.

Reproduced here too. Please try included patches...

Tatsuo Ishii
t-ishii@sra.co.jp
---------------------------------------------------------------------------
*** postgresql-v6.4/src/backend/storage/large_object/inv_api.c~    Thu Nov  5 17:48:26 1998
--- postgresql-v6.4/src/backend/storage/large_object/inv_api.c    Thu Nov 12 15:52:59 1998
***************
*** 549,556 ****                 tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);             else
tuplen= inv_wrold(obj_desc, buf, nbytes - nwritten, tuple, buffer);         }
 
!         ReleaseBuffer(buffer);          /* move pointers past the amount we just wrote */         buf += tuplen;
--- 549,557 ----                 tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);             else
tuplen= inv_wrold(obj_desc, buf, nbytes - nwritten, tuple, buffer);
 
+             ReleaseBuffer(buffer);         }
!           /* move pointers past the amount we just wrote */         buf += tuplen;


Re: [HACKERS] Re: [BUGS] bug in postgresql-v6.4 on FreeBSD

От
Edmund Mergl
Дата:
Tatsuo Ishii wrote:
> 
> >here is a bug which is reproducible on FreeBSD-2.2.6
> >as well as on FreeBSD-2.2.7:
> >
> >
> >nadia:mergl> echo -n "testing large objects using blob_read" >/tmp/gaga
> >nadia:mergl> createdb pgtest
> >nadia:mergl> psql pgtest
> >...
> >pgtest=> CREATE TABLE lobject ( id int4, loid oid );
> >CREATE
> >pgtest=> INSERT INTO lobject (id, loid) VALUES (1, lo_import('/tmp/gaga'));
> >pqReadData() -- backend closed the channel unexpectedly.
> >        This probably means the backend terminated abnormally before or while processing the request.
> >We have lost the connection to the backend, so further processing is impossible.  Terminating.
> 
> Reproduced here too. Please try included patches...
> 
> Tatsuo Ishii
> t-ishii@sra.co.jp
> ---------------------------------------------------------------------------
> *** postgresql-v6.4/src/backend/storage/large_object/inv_api.c~ Thu Nov  5 17:48:26 1998
> --- postgresql-v6.4/src/backend/storage/large_object/inv_api.c  Thu Nov 12 15:52:59 1998
> ***************
> *** 549,556 ****
>                                 tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);
>                         else
>                                 tuplen = inv_wrold(obj_desc, buf, nbytes - nwritten, tuple, buffer);
>                 }
> !               ReleaseBuffer(buffer);
> 
>                 /* move pointers past the amount we just wrote */
>                 buf += tuplen;
> --- 549,557 ----
>                                 tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);
>                         else
>                                 tuplen = inv_wrold(obj_desc, buf, nbytes - nwritten, tuple, buffer);
> +                       ReleaseBuffer(buffer);
>                 }
> !
> 
>                 /* move pointers past the amount we just wrote */
>                 buf += tuplen;



yes, this patch works also for me.
It is needed to pass 'make test' for DBD-Pg-0.89.


thanks
Edmund
-- 
Edmund Mergl          mailto:E.Mergl@bawue.de
Im Haldenhau 9        http://www.bawue.de/~mergl
70565 Stuttgart       fon: +49 711 747503
Germany