diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-05 19:48:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-05 19:48:09 +0000 |
commit | c3a153afed84e29dac664bdc6123724a9e3a906f (patch) | |
tree | 8249c3dd76ddc9874656ec36f763227327c0a70e /src/backend/commands/tablecmds.c | |
parent | 24a1e20f146f3b4b88f0f5189a7631c511796310 (diff) | |
download | postgresql-c3a153afed84e29dac664bdc6123724a9e3a906f.tar.gz postgresql-c3a153afed84e29dac664bdc6123724a9e3a906f.zip |
Tweak palloc/repalloc to allow zero bytes to be requested, as per recent
proposal. Eliminate several dozen now-unnecessary hacks to avoid palloc(0).
(It's likely there are more that I didn't find.)
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 492532363a5..66c1b95135a 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.110 2004/06/04 20:35:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.111 2004/06/05 19:48:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -727,10 +727,10 @@ MergeAttributes(List *schema, List *supers, bool istemp, * newattno[] will contain the child-table attribute numbers for * the attributes of this parent table. (They are not the same * for parents after the first one, nor if we have dropped - * columns.) +1 is to prevent error if parent has zero columns. + * columns.) */ newattno = (AttrNumber *) - palloc((tupleDesc->natts + 1) * sizeof(AttrNumber)); + palloc(tupleDesc->natts * sizeof(AttrNumber)); for (parent_attno = 1; parent_attno <= tupleDesc->natts; parent_attno++) |