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 */
38203820Assert (!reln -> rd_istemp );
3821+ /* nor when there are no tuples to freeze */
3822+ Assert (offcnt > 0 );
38213823
38223824xlrec .node = reln -> rd_node ;
38233825xlrec .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 );
38463840rdata [1 ].buffer = buffer ;
38473841rdata [1 ].buffer_std = true;
38483842rdata [1 ].next = NULL ;