partial PGresult in pgsql v8.2rc1 - Mailing list pgsql-bugs

From Igor Shevchenko
Subject partial PGresult in pgsql v8.2rc1
Date
Msg-id 200612010214.10400.igor@carcass.ath.cx
Whole thread Raw
Responses Re: partial PGresult in pgsql v8.2rc1
List pgsql-bugs
Hi All,

I've been using partial PGresult-s since pgsql v7.4, and one of "signs" that
it's there (after a "read" event on a non-blocking tcp connection to pgsql +
a call to PQconsumeInput) is a check: "pgconn->result != NULL", where pgconn
is a pointer to a PGconn object. Looks like in v8.2rc1, the "result" can have
wrong pointers - my test app dies with the following trace:

#0  0x00e065a8 in PQntuples (res=0x11f) at fe-exec.c:2063
#1  0x080a1a75 in pg::db::can_read (this=0xa3b2f78) at pgdb.cpp:197

where: pgdb.cpp:

197:    if ( conn->result != NULL && PQntuples ( conn->result ) ) {

fe-exec.c:2063:

int
PQntuples(const PGresult *res)
{
        if (!res)
                return 0;
2063:        return res->ntups;
}


Looks like the "result" has an invalid pointer ? Address=0x11f is unlikely.

--
Best Regards,
Igor Shevchenko

pgsql-bugs by date:

Previous
From: "Mischa Sandberg"
Date:
Subject: Bug? change from 8.0 to 8.2rc1 in checking default expressions
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #2798: Obsolete tiemzone data included