diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2008-10-27 21:50:12 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2008-10-27 21:50:12 +0000 |
commit | c9d1efda962436e98fc881e0ab8057b12e25a8b5 (patch) | |
tree | 207a63fb764aec8387caccd6ec1f7c6a7e3300b3 /src | |
parent | e98ca4d38335ce720778d6d751eb30b9a88f0f28 (diff) | |
download | postgresql-c9d1efda962436e98fc881e0ab8057b12e25a8b5.tar.gz postgresql-c9d1efda962436e98fc881e0ab8057b12e25a8b5.zip |
No need for extra code to log freezing zero tuples. Callers already check that
they are freezing a nonzero amount anyway.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/heap/heapam.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 79b92b329e1..ae21c3613e3 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.265 2008/10/08 01:14:44 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.266 2008/10/27 21:50:12 alvherre Exp $ * * * INTERFACE ROUTINES @@ -3818,6 +3818,8 @@ log_heap_freeze(Relation reln, Buffer buffer, /* Caller should not call me on a temp relation */ Assert(!reln->rd_istemp); + /* nor when there are no tuples to freeze */ + Assert(offcnt > 0); xlrec.node = reln->rd_node; xlrec.block = BufferGetBlockNumber(buffer); @@ -3833,16 +3835,8 @@ log_heap_freeze(Relation reln, Buffer buffer, * it is. When XLogInsert stores the whole buffer, the offsets array need * not be stored too. */ - if (offcnt > 0) - { - rdata[1].data = (char *) offsets; - rdata[1].len = offcnt * sizeof(OffsetNumber); - } - else - { - rdata[1].data = NULL; - rdata[1].len = 0; - } + rdata[1].data = (char *) offsets; + rdata[1].len = offcnt * sizeof(OffsetNumber); rdata[1].buffer = buffer; rdata[1].buffer_std = true; rdata[1].next = NULL; |