Re: [BUGS] object_classes array is broken, again
Вложения
В списке pgsql-hackers по дате отправления:
| От | Alvaro Herrera |
|---|---|
| Тема | Re: [BUGS] object_classes array is broken, again |
| Дата | |
| Msg-id | 20150720163315.GS2301@postgresql.org обсуждение исходный текст |
| Ответ на | Re: [BUGS] object_classes array is broken, again (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: [BUGS] object_classes array is broken, again
|
| Список | pgsql-hackers |
Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Any opinions on this idea? I don't like it all that much, but it's
> > plenty effective.
>
> I don't like it much either.
>
> What about adding StaticAsserts that lengthof() the relevant constant
> arrays is equal to MAX_OCLASS? (Or other similar ways of checking
> that they have the right number of entries.)
Well, the array itself is declared like this:
static const Oid object_classes[MAX_OCLASS] = {
so testing lengthof() of it is useless because it's a constant and the
assertion always holds. If it were declared like this instead:
static const Oid object_classes[] = {
then we could use lengthof().
I don't see any drawwbacks to that.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера