diff --git a/src/common/backend/nodes/outfuncs.cpp b/src/common/backend/nodes/outfuncs.cpp index 5991c615b20dc3ae589dc432aca9ee2938254bcc..4c9522f598e6b7c1351b0d9ddfd80bcf240e52e1 100755 --- a/src/common/backend/nodes/outfuncs.cpp +++ b/src/common/backend/nodes/outfuncs.cpp @@ -578,7 +578,7 @@ static void _outPlannedStmt(StringInfo str, PlannedStmt* node) WRITE_INT_FIELD(gather_count); WRITE_INT_FIELD(num_nodes); - if (t_thrd.proc->workingVersionNum < 92097 || node->num_streams > 0) { + if ((t_thrd.proc->workingVersionNum < 92097 || node->num_streams > 0) && node->nodesDefinition != NULL) { for (int i = 0; i < node->num_nodes; i++) { /* Write the field name only one time and just append the value of each field */ appendStringInfo(str, " :nodesDefinition[%d]", i);