diff --git a/tsl/src/reorder.c b/tsl/src/reorder.c index 5b3749f15..196e905a5 100644 --- a/tsl/src/reorder.c +++ b/tsl/src/reorder.c @@ -729,6 +729,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose, CHECK_FOR_INTERRUPTS(); + Assert((heapScan != NULL && indexScan == NULL) || (indexScan != NULL && heapScan == NULL)); if (indexScan != NULL) { tuple = index_getnext(indexScan, ForwardScanDirection); @@ -741,7 +742,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose, buf = indexScan->xs_cbuf; } - else + if (heapScan != NULL) { tuple = heap_getnext(heapScan, ForwardScanDirection); if (tuple == NULL)