File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate,
597
597
598
598
/* Estimate space for query text. */
599
599
query_len = strlen (estate -> es_sourceText );
600
- shm_toc_estimate_chunk (& pcxt -> estimator , query_len );
600
+ shm_toc_estimate_chunk (& pcxt -> estimator , query_len + 1 );
601
601
shm_toc_estimate_keys (& pcxt -> estimator , 1 );
602
602
603
603
/* Estimate space for serialized PlannedStmt. */
@@ -672,8 +672,8 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate,
672
672
shm_toc_insert (pcxt -> toc , PARALLEL_KEY_EXECUTOR_FIXED , fpes );
673
673
674
674
/* Store query string */
675
- query_string = shm_toc_allocate (pcxt -> toc , query_len );
676
- memcpy (query_string , estate -> es_sourceText , query_len );
675
+ query_string = shm_toc_allocate (pcxt -> toc , query_len + 1 );
676
+ memcpy (query_string , estate -> es_sourceText , query_len + 1 );
677
677
shm_toc_insert (pcxt -> toc , PARALLEL_KEY_QUERY_TEXT , query_string );
678
678
679
679
/* Store serialized PlannedStmt. */
You can’t perform that action at this time.
0 commit comments