lo_creat() bug

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: lo_creat() bug
Date: 2001-09-17 08:37:49
Message-ID: Pine.LNX.4.21.0109171818430.12374-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I was just looking through libpq large object code an noticed what seemed
to be a bug. The function lo_create() is declared as Oid yet it contains
the following code:

if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
return -1;
}

If lo_initialize returns < 0, you have some pretty serious problems - out
of memory, conn is invalid, etc. However, casting -1 to Oid returns what
seems to be a valid Oid. Shouldn't it return InvalidOid?

Gavin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Burak Bilen 2001-09-17 10:00:50 Re: pg_dump error - LOCALIZATION PROBLEM
Previous Message Thomas Lockhart 2001-09-17 06:28:51 Re: [Fwd: [Fwd: [tao-users] FW: HEADS UP: CVSup timestamp bug]]