PQconnectdb/PQerrorMessage changed behavior on master

Started by Alexander Lakhinover 4 years ago3 messages
#1Alexander Lakhin
exclusion@gmail.com

Hello,

While trying to use sqlsmith with postgres compiled from the master
branch, I've found that the PQerrorMessage() function now returns
non-informational but not empty error message after the successful
PQconnectdb() call.
    conn = PQconnectdb(conninfo.c_str());
    char *errmsg = PQerrorMessage(conn);
returns
'connection to server on socket "/tmp/ody8OuOaqV/.s.PGSQL.59860" failed: '

The affected sqlsmith code:
https://github.com/anse1/sqlsmith/blob/master/postgres.cc#L305

Best regards,
Alexander

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Lakhin (#1)
Re: PQconnectdb/PQerrorMessage changed behavior on master

Alexander Lakhin <exclusion@gmail.com> writes:

While trying to use sqlsmith with postgres compiled from the master
branch, I've found that the PQerrorMessage() function now returns
non-informational but not empty error message after the successful
PQconnectdb() call.

Yeah, see thread here:

/messages/by-id/20210506162651.GJ27406@telsasoft.com

sqlsmith is definitely Doing It Wrong there, but there's a
reasonable question whether such coding is common.

regards, tom lane

#3Alexander Lakhin
exclusion@gmail.com
In reply to: Tom Lane (#2)
Re: PQconnectdb/PQerrorMessage changed behavior on master

27.06.2021 23:07, Tom Lane wrote:

While trying to use sqlsmith with postgres compiled from the master
branch, I've found that the PQerrorMessage() function now returns
non-informational but not empty error message after the successful
PQconnectdb() call.

Yeah, see thread here:

/messages/by-id/20210506162651.GJ27406@telsasoft.com

sqlsmith is definitely Doing It Wrong there, but there's a
reasonable question whether such coding is common.

Thanks for info! I agree that sqlsmith's check is incorrect, nonetheless
I was embarrassed by the incomplete error message.

Best regards,
Alexander