Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit152a569

Browse files
committed
Backport addition of rs_old_rel to rewriteheap's state.
Originally part ofb89e151, theintroduction of logical decoding, this is required to backport acommit introducing error checks defending against recent bugs.It's possible that extensions calls begin_heap_rewrite(), but it seemshighly unlikely. But if so, they'd break.Author: Andres FreundDiscussion:https://postgr.es/m/20171215010029.3dxx56vjlymudvwo@alap3.anarazel.de
1 parentd5f767c commit152a569

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

‎src/backend/access/heap/rewriteheap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
*/
121121
typedefstructRewriteStateData
122122
{
123+
Relationrs_old_rel;/* source heap */
123124
Relationrs_new_rel;/* destination heap */
124125
Pagers_buffer;/* page currently being built */
125126
BlockNumberrs_blockno;/* block where page will go */
@@ -187,7 +188,7 @@ static void raw_heap_insert(RewriteState state, HeapTuple tup);
187188
* to be used in subsequent calls to the other functions.
188189
*/
189190
RewriteState
190-
begin_heap_rewrite(Relationnew_heap,TransactionIdoldest_xmin,
191+
begin_heap_rewrite(Relationold_heap,Relationnew_heap,TransactionIdoldest_xmin,
191192
TransactionIdfreeze_xid,MultiXactIdcutoff_multi,
192193
booluse_wal)
193194
{
@@ -210,6 +211,7 @@ begin_heap_rewrite(Relation new_heap, TransactionId oldest_xmin,
210211
/* Create and fill in the state struct */
211212
state=palloc0(sizeof(RewriteStateData));
212213

214+
state->rs_old_rel=old_heap;
213215
state->rs_new_rel=new_heap;
214216
state->rs_buffer= (Page)palloc(BLCKSZ);
215217
/* new_heap needn't be empty, just locked */

‎src/backend/commands/cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex,
887887
is_system_catalog=IsSystemRelation(OldHeap);
888888

889889
/* Initialize the rewrite operation */
890-
rwstate=begin_heap_rewrite(NewHeap,OldestXmin,FreezeXid,
890+
rwstate=begin_heap_rewrite(OldHeap,NewHeap,OldestXmin,FreezeXid,
891891
MultiXactCutoff,use_wal);
892892

893893
/*

‎src/include/access/rewriteheap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* struct definition is private to rewriteheap.c */
2020
typedefstructRewriteStateData*RewriteState;
2121

22-
externRewriteStatebegin_heap_rewrite(RelationNewHeap,
22+
externRewriteStatebegin_heap_rewrite(RelationOldHeap,RelationNewHeap,
2323
TransactionIdOldestXmin,TransactionIdFreezeXid,
2424
MultiXactIdMultiXactCutoff,booluse_wal);
2525
externvoidend_heap_rewrite(RewriteStatestate);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp