Use of uninitialized variables in ExecFindPartition() for parentpartition without leaves (HEAD only)

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Use of uninitialized variables in ExecFindPartition() for parentpartition without leaves (HEAD only)
Дата
Msg-id CAB7nPqQ3mwkdMoPY-ocgTpPnjd8TKOadMxdTtMLvEzF8480Zfg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Use of uninitialized variables in ExecFindPartition() for parentpartition without leaves (HEAD only)
Список pgsql-hackers
Hi all,

Since commit 4e5fe9ad (committer Robert Haas and author Amit Langote),
coverity has been complaining that the new code of ExecFindPartition()
may use a set of values and isnull values which never get initialized.
This is a state which can be easily reached with the following SQLs of
a parent partition with no children:
create table parent_tab (a int) partition by list ((a+0));
insert into parent_tab values (1);

The mistake is visibly that FormPartitionKeyDatum() should be called
even for a root partition, initializing the fields of isnull and
values on the way. That's actually what happens in execMain.c's
ExecFindPartition() if you look at REL_10_STABLE. So the answer would
be to move a bit down the quick exit code. Attached is a patch.

Amit, that's your code. What do you think?

Thanks,
-- 
Michael

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Issues with logical replication
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] Issues with logical replication