Avoid mix char with bool type in comparisons

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Avoid mix char with bool type in comparisons
Дата
Msg-id CAEudQApbr_v76BWsPK4oe6+pEfra7QG1PmSRJRVK64C7jrGWjg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Avoid mix char with bool type in comparisons
Список pgsql-hackers
Hi,

GIN Indexes:

Defines a type char GinTernaryValue with 3 values:
#define GIN_FALSE 0 /* item is not present / does not match */
#define GIN_TRUE 1 /* item is present / matches */
#define GIN_MAYBE 2 /* don't know if item is present / don't know
* if matches */

So, any use of this GinTernaryValue are:

1. if (key->entryRes[j]) be FALSE if GIN_FALSE
2. if (key->entryRes[j]) be TRUE if GIN_TRUE
3. if (key->entryRes[j]) be TRUE if GIN_MAYBE

So gin matchs can fail with GYN_MAYBE or I lost something?

regards,
Ranier Vilela
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Reducing the chunk header sizes on all memory context types
Следующее
От: Zheng Li
Дата:
Сообщение: Re: Support logical replication of DDLs