File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -897,8 +897,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
897
897
898
898
/* write all mappings consecutively */
899
899
len = src -> num_mappings * sizeof (LogicalRewriteMappingData );
900
- waldata = palloc (len );
901
- waldata_start = waldata ;
900
+ waldata_start = waldata = palloc (len );
902
901
903
902
/*
904
903
* collect data we need to write out, but don't modify ondisk data yet
@@ -921,6 +920,9 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
921
920
src -> num_mappings -- ;
922
921
}
923
922
923
+ Assert (src -> num_mappings == 0 );
924
+ Assert (waldata == waldata_start + len );
925
+
924
926
/*
925
927
* Note that we deviate from the usual WAL coding practices here,
926
928
* check the above "Logical rewrite support" comment for reasoning.
@@ -933,8 +935,6 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
933
935
written , len )));
934
936
src -> off += len ;
935
937
936
- Assert (src -> num_mappings == 0 );
937
-
938
938
rdata [1 ].data = waldata_start ;
939
939
rdata [1 ].len = len ;
940
940
rdata [1 ].buffer = InvalidBuffer ;
@@ -943,6 +943,7 @@ logical_heap_rewrite_flush_mappings(RewriteState state)
943
943
/* write xlog record */
944
944
XLogInsert (RM_HEAP2_ID , XLOG_HEAP2_REWRITE , rdata );
945
945
946
+ pfree (waldata_start );
946
947
}
947
948
Assert (state -> rs_num_rewrite_mappings == 0 );
948
949
}
You can’t perform that action at this time.
0 commit comments