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

Commit8398c83

Browse files
committed
Handle empty result set in libpqrcv_exec
Always return tupleslot and tupledesc from libpqrcv_exec. This avoidsrequiring callers to handle that separately.Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>Reported-by: Michael Banck <michael.banck@credativ.de>
1 parent7ac955b commit8398c83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,6 @@ libpqrcv_processTuples(PGresult *pgres, WalRcvExecResult *walres,
803803
MemoryContextrowcontext;
804804
MemoryContextoldcontext;
805805

806-
/* No point in doing anything here if there were no tuples returned. */
807-
if (PQntuples(pgres)==0)
808-
return;
809-
810806
/* Make sure we got expected number of fields. */
811807
if (nfields!=nRetTypes)
812808
ereport(ERROR,
@@ -824,6 +820,10 @@ libpqrcv_processTuples(PGresult *pgres, WalRcvExecResult *walres,
824820
PQfname(pgres,coln),retTypes[coln],-1,0);
825821
attinmeta=TupleDescGetAttInMetadata(walres->tupledesc);
826822

823+
/* No point in doing more here if there were no tuples returned. */
824+
if (PQntuples(pgres)==0)
825+
return;
826+
827827
/* Create temporary context for local allocations. */
828828
rowcontext=AllocSetContextCreate(CurrentMemoryContext,
829829
"libpqrcv query result context",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp