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

Commitf81648c

Browse files
committed
Fix bugs in the COPY heap-insert batching patch.
Forgot to call RestoreBkpBlocks() in the redo-function, as pointed out bySimon Riggs. In redo of a regular heap insert, it's taken care of inheap_redo(), but this new record type uses the heap2 RM, and heap2_redo()does not take care of that for you.Also, failed to reset the vmbuffer and all_visibile_cleared local variablesafter switching to a new buffer.
1 parent3ad2c8e commitf81648c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,6 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
20882088
{
20892089
TransactionIdxid=GetCurrentTransactionId();
20902090
HeapTuple*heaptuples;
2091-
Bufferbuffer;
2092-
Buffervmbuffer=InvalidBuffer;
2093-
boolall_visible_cleared= false;
20942091
inti;
20952092
intndone;
20962093
char*scratch=NULL;
@@ -2128,6 +2125,9 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
21282125
ndone=0;
21292126
while (ndone<ntuples)
21302127
{
2128+
Bufferbuffer;
2129+
Buffervmbuffer=InvalidBuffer;
2130+
boolall_visible_cleared= false;
21312131
intnthispage;
21322132

21332133
/*
@@ -5038,6 +5038,13 @@ heap_xlog_multi_insert(XLogRecPtr lsn, XLogRecord *record)
50385038
inti;
50395039
boolisinit= (record->xl_info&XLOG_HEAP_INIT_PAGE)!=0;
50405040

5041+
/*
5042+
* Insertion doesn't overwrite MVCC data, so no conflict processing is
5043+
* required.
5044+
*/
5045+
5046+
RestoreBkpBlocks(lsn,record, false);
5047+
50415048
xlrec= (xl_heap_multi_insert*)recdata;
50425049
recdata+=SizeOfHeapMultiInsert;
50435050

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp