diff --git a/contrib/dblink/dblink.cpp b/contrib/dblink/dblink.cpp index 56916f7f6135fd6c712020062087f213252ebc7d..c4c59f447807034dd35e8c8e0d8fc4268309e84b 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. */