mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Ensure attcacheoff is written out as -1 when writing pg_attribute
tuples for a relation. Needed to prevent Assert failure in CLUSTER.
This commit is contained in:
parent
473763e676
commit
9315ff5549
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.155 2000/12/27 23:59:11 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.156 2001/01/01 21:33:31 tgl Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -590,8 +590,11 @@ AddNewAttributeTuples(Oid new_rel_oid,
|
|||||||
dpp = tupdesc->attrs;
|
dpp = tupdesc->attrs;
|
||||||
for (i = 0; i < natts; i++)
|
for (i = 0; i < natts; i++)
|
||||||
{
|
{
|
||||||
|
/* Fill in the correct relation OID */
|
||||||
(*dpp)->attrelid = new_rel_oid;
|
(*dpp)->attrelid = new_rel_oid;
|
||||||
|
/* Make sure these are OK, too */
|
||||||
(*dpp)->attdispersion = 0;
|
(*dpp)->attdispersion = 0;
|
||||||
|
(*dpp)->attcacheoff = -1;
|
||||||
|
|
||||||
tup = heap_addheader(Natts_pg_attribute,
|
tup = heap_addheader(Natts_pg_attribute,
|
||||||
ATTRIBUTE_TUPLE_SIZE,
|
ATTRIBUTE_TUPLE_SIZE,
|
||||||
@ -613,8 +616,12 @@ AddNewAttributeTuples(Oid new_rel_oid,
|
|||||||
dpp = HeapAtt;
|
dpp = HeapAtt;
|
||||||
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
|
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
|
||||||
{
|
{
|
||||||
|
/* Fill in the correct relation OID */
|
||||||
|
/* HACK: we are writing on static data here */
|
||||||
(*dpp)->attrelid = new_rel_oid;
|
(*dpp)->attrelid = new_rel_oid;
|
||||||
/* (*dpp)->attdispersion = 0; unneeded */
|
/* Unneeded since they should be OK in the constant data anyway */
|
||||||
|
/* (*dpp)->attdispersion = 0; */
|
||||||
|
/* (*dpp)->attcacheoff = -1; */
|
||||||
|
|
||||||
tup = heap_addheader(Natts_pg_attribute,
|
tup = heap_addheader(Natts_pg_attribute,
|
||||||
ATTRIBUTE_TUPLE_SIZE,
|
ATTRIBUTE_TUPLE_SIZE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user