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

Commitc9d1efd

Browse files
committed
No need for extra code to log freezing zero tuples. Callers already check that
they are freezing a nonzero amount anyway.
1 parente98ca4d commitc9d1efd

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.265 2008/10/08 01:14:44 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.266 2008/10/27 21:50:12 alvherre Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -3818,6 +3818,8 @@ log_heap_freeze(Relation reln, Buffer buffer,
38183818

38193819
/* Caller should not call me on a temp relation */
38203820
Assert(!reln->rd_istemp);
3821+
/* nor when there are no tuples to freeze */
3822+
Assert(offcnt>0);
38213823

38223824
xlrec.node=reln->rd_node;
38233825
xlrec.block=BufferGetBlockNumber(buffer);
@@ -3833,16 +3835,8 @@ log_heap_freeze(Relation reln, Buffer buffer,
38333835
* it is. When XLogInsert stores the whole buffer, the offsets array need
38343836
* not be stored too.
38353837
*/
3836-
if (offcnt>0)
3837-
{
3838-
rdata[1].data= (char*)offsets;
3839-
rdata[1].len=offcnt*sizeof(OffsetNumber);
3840-
}
3841-
else
3842-
{
3843-
rdata[1].data=NULL;
3844-
rdata[1].len=0;
3845-
}
3838+
rdata[1].data= (char*)offsets;
3839+
rdata[1].len=offcnt*sizeof(OffsetNumber);
38463840
rdata[1].buffer=buffer;
38473841
rdata[1].buffer_std= true;
38483842
rdata[1].next=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp