[odb-users] Failing assert in error.cxx

Boris Kolpackov boris at codesynthesis.com
Sun Dec 21 04:08:24 EST 2014


Hi Philip,

Philip Ethier <philip.ethier at gmail.com> writes:

> I'm seeing a failing assert inside odb/pgsql/error.cxx around line 50. It
> looks like PGresultErrorField is returning a nullptr. I can repeatedly
> trigger the failed assertion by using tcpkill to kill the connection to the
> db. Is there any way around this? If not can a bug fix be put out?

It is not clear at all from the PG's documentation when PGresultErrorField()
can and cannot return NULL. So we put the asserts to "learn more", so to
speak.

I have re-implemented the translate_error() function quite differently.
Can you copy the below error.cxx file into your libodb-pgsql, rebuild
it, and then let me know if everything works as expected in your tests?

http://codesynthesis.com/~boris/tmp/odb/error.cxx

And thanks for the report!

Boris



More information about the odb-users mailing list