Re: pgsql: Add INET/CIDR operators: and, or, not, plus

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Add INET/CIDR operators: and, or, not, plus
Дата
Msg-id 23282.1139687202@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Add INET/CIDR operators: and, or, not, plus  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-committers
Actually this patch has got some worse problems:

regression=# select '127.0.0.1'::inet + 256;
 ?column?
-----------
 127.0.2.1
(1 row)

which is wrong; if that's not obvious try

regression=# select ('127.0.0.1'::inet + 256) - 256;
 ?column?
-----------
 127.0.1.1
(1 row)

or

regression=# select '127::2'::inet  - ('127::2'::inet - 256);
 ?column?
----------
   -65280
(1 row)

I think the overflow checks are wrong, and the current buildfarm
results say there's a portability problem too.  Working on it now...

            regards, tom lane

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

Предыдущее
От: gsmet@pgfoundry.org (User Gsmet)
Дата:
Сообщение: pgfouine - www: reorganized samples
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix incorrect addition, subtraction, and overflow checking in new