summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/rewriteheap.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-12-14 16:50:31 -0800
committerAndres Freund <andres@anarazel.de>2017-12-14 18:20:48 -0800
commit152a56905658b7d9f8927f41f000abac718e1a39 (patch)
tree0eeea1aec39a2414f3bac770dcfdaf5df0c7479b /src/backend/access/heap/rewriteheap.c
parentd5f767c136d2531ad58053498c7236706779f692 (diff)
Backport addition of rs_old_rel to rewriteheap's state.
Originally part of b89e151054a05f0f6d356ca52e3b725dd0505e53, the introduction of logical decoding, this is required to backport a commit introducing error checks defending against recent bugs. It's possible that extensions calls begin_heap_rewrite(), but it seems highly unlikely. But if so, they'd break. Author: Andres Freund Discussion: https://postgr.es/m/20171215010029.3dxx56vjlymudvwo@alap3.anarazel.de
Diffstat (limited to 'src/backend/access/heap/rewriteheap.c')
-rw-r--r--src/backend/access/heap/rewriteheap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 76f972e79f9..82fa7b2d53a 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -120,6 +120,7 @@
*/
typedef struct RewriteStateData
{
+ Relation rs_old_rel; /* source heap */
Relation rs_new_rel; /* destination heap */
Page rs_buffer; /* page currently being built */
BlockNumber rs_blockno; /* block where page will go */
@@ -187,7 +188,7 @@ static void raw_heap_insert(RewriteState state, HeapTuple tup);
* to be used in subsequent calls to the other functions.
*/
RewriteState
-begin_heap_rewrite(Relation new_heap, TransactionId oldest_xmin,
+begin_heap_rewrite(Relation old_heap, Relation new_heap, TransactionId oldest_xmin,
TransactionId freeze_xid, MultiXactId cutoff_multi,
bool use_wal)
{
@@ -210,6 +211,7 @@ begin_heap_rewrite(Relation new_heap, TransactionId oldest_xmin,
/* Create and fill in the state struct */
state = palloc0(sizeof(RewriteStateData));
+ state->rs_old_rel = old_heap;
state->rs_new_rel = new_heap;
state->rs_buffer = (Page) palloc(BLCKSZ);
/* new_heap needn't be empty, just locked */