msg->statement[0] = '\0';
msg->portal[0] = '\0';
msg->is_rows_returned = false;
+ msg->not_forward_to_frontend = false;
msg->node_ids[0] = msg->node_ids[1] = -1;
MemoryContextSwitchTo(old_context);
char statement[MAX_IDENTIFIER_LEN]; /* prepared statment name if any */
char portal[MAX_IDENTIFIER_LEN]; /* portal name if any */
bool is_rows_returned; /* true if the message could produce row data */
+ bool not_forward_to_frontend; /* Do not forward response from backend to frontend.
+ * This is used by parse_before_bind()
+ */
int node_ids[2]; /* backend node ids this message was sent to. -1 means no message was sent. */
POOL_QUERY_CONTEXT *query_context; /* query context */
} POOL_PENDING_MESSAGE;
break;
case '1': /* ParseComplete */
+ if (STREAM)
+ {
+ POOL_PENDING_MESSAGE *pmsg;
+ pmsg = pool_pending_message_get_previous_message();
+ if (pmsg && pmsg->not_forward_to_frontend)
+ {
+ /* parse_before_bind() was called. Do not foward the
+ * parse complete message to frontend. */
+ ereport(LOG,
+ (errmsg("processing backend response"),
+ errdetail("do not forward parse complete message to frontend")));
+ pool_discard_packet_contents(backend);
+ pool_unset_query_in_progress();
+ pool_set_command_success();
+ status = POOL_CONTINUE;
+ break;
+ }
+ }
status = ParseComplete(frontend, backend);
pool_set_command_success();
if (STREAM||REPLICATION||RAW_MODE)
/* Add pending message */
pmsg = pool_pending_messages_create('P', len, contents);
+ pmsg->not_forward_to_frontend = true;
pool_pending_messages_dest_set(pmsg, qc);
pool_pending_message_add(pmsg);