wip-avoid-failure-with-empty-prepared-query.patch

text/x-diff

Filename: wip-avoid-failure-with-empty-prepared-query.patch
Type: text/x-diff
Part: 0
Message: Re: BUG #18984: Empty prepared statement from psql \parse triggers assert in PortalRunMulti

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/tcop/pquery.c 2 2
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index d1593f38b35..2d998e87846 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1365,8 +1365,8 @@ PortalRunMulti(Portal portal,
 	{
 		if (portal->qc.commandTag != CMDTAG_UNKNOWN)
 			CopyQueryCompletion(qc, &portal->qc);
-		/* If the caller supplied a qc, we should have set it by now. */
-		Assert(qc->commandTag != CMDTAG_UNKNOWN);
+		else
+			qc->commandTag = CMDTAG_EXECUTE;
 	}
 }