postgres_fdw: Fix bug in checking of return value of PQsendQuery(). - Mailing list pgsql-hackers

From Fujii Masao
Subject postgres_fdw: Fix bug in checking of return value of PQsendQuery().
Date
Msg-id b187a7cf-d4e3-5a32-4d01-8383677797f3@oss.nttdata.com
Whole thread Raw
Responses Re: postgres_fdw: Fix bug in checking of return value of PQsendQuery().
Re: postgres_fdw: Fix bug in checking of return value of PQsendQuery().
List pgsql-hackers
Hi,

I found that fetch_more_data_begin() in postgres_fdw reports an error when PQsendQuery() returns the value less than 0
asfollows though PQsendQuery() can return only 1 or 0. I think this is  a bug. Attached is the patch that fixes this
bug.This needs to be back-ported to v14 where async execution was supported in postgres_fdw.
 

    if (PQsendQuery(fsstate->conn, sql) < 0)
        pgfdw_report_error(ERROR, NULL, fsstate->conn, false, fsstate->query);

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH v1] eliminate duplicate code in table.c
Next
From: Alexander Korotkov
Date:
Subject: Re: Custom tuplesorts for extensions