Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3ee4c5

Browse files
committed
Cope with NULL query string in ExecInitParallelPlan().
It's far from clear that this is the right approach - but a goodportion of the buildfarm has been red for a few hours, on the last dayof the CF. And this fixes at least the obvious crash. So let's go withthat for now.Discussion:https://postgr.es/m/20210407225806.majgznh4lk34hjvu%40alap3.anarazel.de
1 parent8ffb003 commitb3ee4c5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/executor/execParallel.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate,
647647
shm_toc_estimate_keys(&pcxt->estimator,1);
648648

649649
/* Estimate space for query text. */
650-
query_len=strlen(estate->es_sourceText);
650+
query_len=estate->es_sourceText ?strlen(estate->es_sourceText) :0;
651651
shm_toc_estimate_chunk(&pcxt->estimator,query_len+1);
652652
shm_toc_estimate_keys(&pcxt->estimator,1);
653653

@@ -742,7 +742,10 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate,
742742

743743
/* Store query string */
744744
query_string=shm_toc_allocate(pcxt->toc,query_len+1);
745-
memcpy(query_string,estate->es_sourceText,query_len+1);
745+
if (query_len==0)
746+
query_string[0]=0;
747+
else
748+
memcpy(query_string,estate->es_sourceText,query_len+1);
746749
shm_toc_insert(pcxt->toc,PARALLEL_KEY_QUERY_TEXT,query_string);
747750

748751
/* Store serialized PlannedStmt. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp