question on bits32 wraparound check

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема question on bits32 wraparound check
Дата
Msg-id 20090403224539.GQ23023@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: question on bits32 wraparound check  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
So there's a minor issue on Takahiro-san fillfactor-on-toast patch,
which is that it does not hand out the last possible "kind" value.  This
is a bits32 field, so at least theoretically on some platforms it will
be wider than 32 while on others it will be exactly 32.  I'm wondering
if this is the correct way to check for wraparound:

relopt_kind
add_reloption_kind(void)
{relopt_kind        kind;
/* wraparound check */if (last_assigned_kind > RELOPT_KIND_MAX ||    last_assigned_kind == 0)    ereport(ERROR,
  (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),             errmsg("user-defined relation parameter types limit
exceeded")));
kind = (relopt_kind) last_assigned_kind;last_assigned_kind <<= 1;return kind;
}


Fixing this I'm ready to commit this patch.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: Saner interval hash function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: question on bits32 wraparound check