diff options
-rw-r--r-- | src/backend/utils/sort/tuplesort.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index 015e4ea93b..02cd1d7fe2 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -2216,8 +2216,14 @@ tuplesort_gettuple_common(Tuplesortstate *state, bool forward, * Rewind to free the read buffer. It'd go away at the * end of the sort anyway, but better to release the * memory early. + * + * XXX PG10MERGE: In XL, we use tuplesort_begin_merge() to + * merge tuples from datanode connections. We don't use + * tapeset in that code path. The following fix helps that + * case. */ - LogicalTapeRewindForWrite(state->tapeset, srcTape); + if (state->tapeset) + LogicalTapeRewindForWrite(state->tapeset, srcTape); return true; } newtup.tupindex = srcTape; |