Re: BUG #15471: psql 11 array concatenation in CASE takes on values from the CASE expression when using enum_range

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15471: psql 11 array concatenation in CASE takes on values from the CASE expression when using enum_range
Дата
Msg-id 87efc77gh2.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: BUG #15471: psql 11 array concatenation in CASE takes on values from the CASE expression when using enum_range  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #15471: psql 11 array concatenation in CASE takes on values from the CASE expression when using enum_range  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> Below is an example .sql file that replicates the problem. Put
 >> simply, when we array concat with enum_range in the result of a CASE
 >> statement the concatenation takes the expression from the CASE
 >> statement, not the enum range.

 Tom> Wow, that's ... bizarre. I'm thinking that we probably did
 Tom> something silly in the big expression-execution rewrite, but it's
 Tom> not clear exactly where. Anyway, will look into it if Andres
 Tom> doesn't beat me to it.

I took a look, and what I'm seeing suggests that commit 3decd150a2d
might possibly be relevant here (at least to explain why it breaks in 11
but not 10).

What's going on in eval_const_expressions_mutator is that
context->case_val is set when recursing into the elemexpr in the
ArrayCoerceExpr case, so when that sees a CaseTestExpr inside that, it
replaces it (incorrectly).

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15471: psql 11 array concatenation in CASE takes on values from the CASE expression when using enum_range
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15467: The database subdirectory "pg_tblspc/1932420460/PG_10_201707211/16400" is missing.