|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * IDENTIFICATION
|
12 |
| - * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.82 2002/09/04 20:31:08momjian Exp $ |
| 12 | + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.83 2002/09/27 15:04:08tgl Exp $ |
13 | 13 | *
|
14 | 14 | * NOTES
|
15 | 15 | * The old interface functions have been converted to macros
|
@@ -617,18 +617,16 @@ heap_formtuple(TupleDesc tupleDescriptor,
|
617 | 617 | td->t_natts=numberOfAttributes;
|
618 | 618 | td->t_hoff=hoff;
|
619 | 619 |
|
| 620 | +if (tupleDescriptor->tdhasoid)/* else leave infomask = 0 */ |
| 621 | +td->t_infomask=HEAP_HASOID; |
| 622 | + |
620 | 623 | DataFill((char*)td+hoff,
|
621 | 624 | tupleDescriptor,
|
622 | 625 | value,
|
623 | 626 | nulls,
|
624 | 627 | &td->t_infomask,
|
625 | 628 | (hasnull ?td->t_bits :NULL));
|
626 | 629 |
|
627 |
| -if (tupleDescriptor->tdhasoid) |
628 |
| -td->t_infomask |=HEAP_HASOID; |
629 |
| - |
630 |
| -td->t_infomask |=HEAP_XMAX_INVALID; |
631 |
| - |
632 | 630 | returntuple;
|
633 | 631 | }
|
634 | 632 |
|
@@ -736,8 +734,12 @@ heap_freetuple(HeapTuple htup)
|
736 | 734 | *
|
737 | 735 | * This routine forms a HeapTuple by copying the given structure (tuple
|
738 | 736 | * data) and adding a generic header. Note that the tuple data is
|
739 |
| - * presumed to contain no null fields.It is typically only useful |
740 |
| - * for null-free system tables. |
| 737 | + * presumed to contain no null fields and no varlena fields. |
| 738 | + * |
| 739 | + * This routine is really only useful for certain system tables that are |
| 740 | + * known to be fixed-width and null-free. It is used in some places for |
| 741 | + * pg_class, but that is a gross hack (it only works because relacl can |
| 742 | + * be omitted from the tuple entirely in those places). |
741 | 743 | * ----------------
|
742 | 744 | */
|
743 | 745 | HeapTuple
|
@@ -770,9 +772,11 @@ heap_addheader(int natts,/* max domain index */
|
770 | 772 |
|
771 | 773 | MemSet((char*)td,0,hoff);
|
772 | 774 |
|
773 |
| -td->t_hoff=hoff; |
774 | 775 | td->t_natts=natts;
|
775 |
| -td->t_infomask=withoid ? (HEAP_XMAX_INVALID |HEAP_HASOID) :HEAP_XMAX_INVALID; |
| 776 | +td->t_hoff=hoff; |
| 777 | + |
| 778 | +if (withoid)/* else leave infomask = 0 */ |
| 779 | +td->t_infomask=HEAP_HASOID; |
776 | 780 |
|
777 | 781 | memcpy((char*)td+hoff,structure,structlen);
|
778 | 782 |
|
|