From: | Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: object_classes array is broken, again |
Date: | 2015-06-26 22:22:55 |
Message-ID: | 558DD0BF.1000407@BlueTreble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 6/24/15 2:11 PM, Robert Haas wrote:
> Fixing this is easy, but ISTM that we need to insert some sort of a
> guard to prevent people from continuing to forget this, because it's
> apparently quite easy to do. Perhaps add_object_address should
> Assert(OidIsValid(object_classes[oclass])), plus a (static?) assert
> someplace checking that OidIsValid(object_classes[MAX_OCLASS - 1])?
I tried doing this and I'm getting a "static_assert expression is not an
integral constant expression" error, even when I reduce it to a simple
constant comparison. Maybe I'm just doing something dumb...
If I replace the StaticAssert with
Assert(OidIsValid(object_classes[MAX_OCLASS - 1])) it works find and
initdb will fail if that assert trips.
I've attached the broken StaticAssert version. Also added a warning
comment to the enum.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Data in Trouble? Get it in Treble! http://BlueTreble.com
Attachment | Content-Type | Size |
---|---|---|
oclass_broken.patch | text/plain | 1.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Nasby | 2015-06-26 22:30:07 | Re: pg_stat_*_columns? |
Previous Message | Alvaro Herrera | 2015-06-26 21:14:31 | Re: BRIN index bug due to WAL refactoring |