Fix GetOperatorFromCompareType

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема Fix GetOperatorFromCompareType
Дата
Msg-id CA+renyXOrjLacP_nhqEQUf2W+ZCoY2q5kpQCfG05vQVYzr8b9w@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi Hackers,

I found a few problems with GetOperatorFromCompareType and fixed them here.

First of all, the comment was out of date: we never return
InvalidStrategy; instead we ereport.

Second, we were potentially using uninitialized Oids to build error
messages (if get_opclass_opfamily_and_input_type failed). If that
function fails, we should just die. In fact since get_opclass_method
just succeeded, which makes the same lookup, how could it ever fail? I
don't think we need to try very hard to build a fancy message.

Failing right away simplifies the logic, because we only reach the
bottom of the function one way. And I think we can make things ever
clearer by inverting the conditional, so it acts like a guard, and we
can avoid some nesting.

Based on acbc9beaae.

Yours,

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com

Вложения

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