From 7cdc608d97c4e51483e4e698abeef886300306ff Mon Sep 17 00:00:00 2001 From: chenzhikai <895543892@qq.com> Date: Mon, 15 May 2023 17:23:57 +0800 Subject: [PATCH] =?UTF-8?q?dblink=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/dblink/dblink.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/dblink/dblink.cpp b/contrib/dblink/dblink.cpp index 56916f7f61..c4c59f4478 100644 --- a/contrib/dblink/dblink.cpp +++ b/contrib/dblink/dblink.cpp @@ -1486,12 +1486,13 @@ static void storeRow(storeInfo* sinfo, PGresult* res, bool first) */ oldcontext = MemoryContextSwitchTo(sinfo->tmpcontext); - /* Should have a single-row result if we get here */ - Assert(PQntuples(res) == 1); - /* Done if empty resultset */ if (PQntuples(res) == 0) - return; + return; + + /* Should have a single-row result if we get here */ + Assert(PQntuples(res) == 1); + /* * Fill cstrs with null-terminated strings of column values. */ -- Gitee