Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63a8c68

Browse files
committed
postgres_fdw: Fix bug in checking of return value of PQsendQuery().
When postgres_fdw begins an asynchronous data fetch, it submits FETCH queryby using PQsendQuery(). If PQsendQuery() fails and returns 0, postgres_fdwshould report an error. But, previously, postgres_fdw reported an erroronly when the return value is less than 0, though PQsendQuery() never returnthe values other than 0 and 1. Therefore postgres_fdw could not handlethe failure to send FETCH query in an asynchronous data fetch.This commit fixes postgres_fdw so that it reports an errorwhen PQsendQuery() returns 0.Back-patch to v14 where asynchronous execution was supported in postgres_fdw.Author: Fujii MasaoReviewed-by: Japin Li, Tom LaneDiscussion:https://postgr.es/m/b187a7cf-d4e3-5a32-4d01-8383677797f3@oss.nttdata.com
1 parentd5623c4 commit63a8c68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7078,7 +7078,7 @@ fetch_more_data_begin(AsyncRequest *areq)
70787078
snprintf(sql,sizeof(sql),"FETCH %d FROM c%u",
70797079
fsstate->fetch_size,fsstate->cursor_number);
70807080

7081-
if (PQsendQuery(fsstate->conn,sql)<0)
7081+
if (!PQsendQuery(fsstate->conn,sql))
70827082
pgfdw_report_error(ERROR,NULL,fsstate->conn, false,fsstate->query);
70837083

70847084
/* Remember that the request is in process */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp