Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Дата
Msg-id CAMbWs4-Z8hSnHOTrCV4-Pp1+H9+i34O68pSkhEHLyDpYfPyqpQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Список pgsql-bugs

On Tue, Oct 11, 2022 at 6:05 PM Richard Guo <guofenglinux@gmail.com> wrote:

On Tue, Oct 11, 2022 at 5:48 PM PG Bug reporting form <noreply@postgresql.org> wrote:
-- must multi values.
insert into v1 values (1,default),(2, default);
=> it will trigger cache lookup failed for type.
 
Thanks for the report! I can reproduce this issue.

Apparently there is something wrong when we process the DEFAULT marker
in rewriteValuesRTE, because the contents inside att_tup are invalid.

    p /x att_tup->atttypid
    $13 = 0x7f7f7f7f
 
I think the problem exists for auto-updatable view, as we leave the
DEFAULT items untouched because we expect to apply the underlying base
rel's default.

In this case there is a rewrite rule on the view.  Applying the rule
we'd get a product query whose target entries referring to the VALUES
RTE have attribute 3 and 4 while the relation has only two attributes.
Then we proceed to replacing the remaining DEFAULT items with NULLs.
And when we try to access the relation's 3rd and 4th attributes, we are
accessing illegal memory areas.

Thanks
Richard

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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.
Следующее
От: Japin Li
Дата:
Сообщение: Re: BUG #17633: Define rule on views which do insert to another relation trigger cache lookup failed error.