|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.70 2003/03/21 15:43:02 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.71 2003/04/21 15:19:55 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -591,9 +591,10 @@ MergeAttributes(List *schema, List *supers, bool istemp,
|
591 | 591 | * newattno[] will contain the child-table attribute numbers for
|
592 | 592 | * the attributes of this parent table. (They are not the same
|
593 | 593 | * for parents after the first one, nor if we have dropped
|
594 |
| - * columns.) |
| 594 | + * columns.) +1 is to prevent error if parent has zero columns. |
595 | 595 | */
|
596 |
| -newattno= (AttrNumber*)palloc(tupleDesc->natts*sizeof(AttrNumber)); |
| 596 | +newattno= (AttrNumber*) |
| 597 | +palloc((tupleDesc->natts+1)*sizeof(AttrNumber)); |
597 | 598 |
|
598 | 599 | for (parent_attno=1;parent_attno <=tupleDesc->natts;
|
599 | 600 | parent_attno++)
|
|