int4->bool test coverage

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема int4->bool test coverage
Дата
Msg-id ZYQZ1hNfLd_4rzkn@msg.df7cb.de
обсуждение исходный текст
Ответы Re: int4->bool test coverage  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
I was surprised to learn that 2 is a valid boolean (thanks Berge):

# select 2::boolean;
 bool
──────
 t

... while '2' is not:

# select '2'::boolean;
ERROR:  22P02: invalid input syntax for type boolean: "2"
LINE 1: select '2'::boolean;
               ^
LOCATION:  boolin, bool.c:151


The first cast is the int4_bool function, but it isn't covered by the
regression tests at all. The attached patch adds tests.

Christoph

Вложения

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: ci: Build standalone INSTALL file
Следующее
От: Jelte Fennema-Nio
Дата:
Сообщение: Re: Add --check option to pgindent