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

Commitdd24098

Browse files
author
Etsuro Fujita
committed
postgres_fdw: Remove useless ternary expression.
There is no case where we would call pgfdw_exec_cleanup_query orpgfdw_exec_cleanup_query_{begin,end} with a NULL query string, so thisexpression is pointless; remove it and instead add to the latterfunctions an assertion ensuring the given query string is not NULL.Thinko in commit815d61f.Discussion:https://postgr.es/m/CAPmGK14mm%2B%3DUjyjoWj_Hu7c%2BQqX-058RFfF%2BqOkcMZ_Nj52v-A%40mail.gmail.com
1 parent3a4a353 commitdd24098

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎contrib/postgres_fdw/connection.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,8 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
14171417
staticbool
14181418
pgfdw_exec_cleanup_query_begin(PGconn*conn,constchar*query)
14191419
{
1420+
Assert(query!=NULL);
1421+
14201422
/*
14211423
* Submit a query. Since we don't use non-blocking mode, this also can
14221424
* block. But its risk is relatively small, so we ignore that for now.
@@ -1438,6 +1440,8 @@ pgfdw_exec_cleanup_query_end(PGconn *conn, const char *query,
14381440
PGresult*result=NULL;
14391441
booltimed_out;
14401442

1443+
Assert(query!=NULL);
1444+
14411445
/*
14421446
* If requested, consume whatever data is available from the socket. (Note
14431447
* that if all data is available, this allows pgfdw_get_cleanup_result to
@@ -1456,7 +1460,7 @@ pgfdw_exec_cleanup_query_end(PGconn *conn, const char *query,
14561460
if (timed_out)
14571461
ereport(WARNING,
14581462
(errmsg("could not get query result due to timeout"),
1459-
query ?errcontext("remote SQL command: %s",query) :0));
1463+
errcontext("remote SQL command: %s",query)));
14601464
else
14611465
pgfdw_report_error(WARNING,NULL,conn, false,query);
14621466

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp