summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2018-10-12 12:23:29 +0000
committerTomas Vondra2018-10-12 12:54:37 +0000
commitfe96e7a90ee99ceae6036eba7e8a9f9427d5cdec (patch)
treed18d1b8bc170d7e633da229d639e20f335cfde9b
parent5d892856f6733f3f2367c5d435cc2ee825b14cab (diff)
Use sufficiently large buffer in SharedQueueWrite
The sq_key alone may be up to 64 bytes, so we need more than that. We could use dynamic memory instead, but 128 bytes should be enough both for the sq_key and the other pieces.
-rw-r--r--src/backend/pgxc/squeue/squeue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/pgxc/squeue/squeue.c b/src/backend/pgxc/squeue/squeue.c
index a938571147..63fdbcd5f5 100644
--- a/src/backend/pgxc/squeue/squeue.c
+++ b/src/backend/pgxc/squeue/squeue.c
@@ -857,15 +857,15 @@ SharedQueueWrite(SharedQueue squeue, int consumerIdx,
if (*tuplestore == NULL)
{
int ptrno;
- char storename[64];
+ char storename[128];
#ifdef SQUEUE_STAT
elog(DEBUG1, "Start buffering %s node %d, %d tuples in queue, %ld writes and %ld reads so far",
squeue->sq_key, cstate->cs_node, cstate->cs_ntuples, cstate->stat_writes, cstate->stat_reads);
#endif
*tuplestore = tuplestore_begin_datarow(false, work_mem, tmpcxt);
- /* We need is to be able to remember/restore the read position */
- snprintf(storename, 64, "%s node %d", squeue->sq_key, cstate->cs_node);
+ /* We need to be able to remember/restore the read position. */
+ snprintf(storename, 128, "%s node %d", squeue->sq_key, cstate->cs_node);
tuplestore_collect_stat(*tuplestore, storename);
/*
* Allocate a second read pointer to read from the store. We know