[PATCH] ECPG bug fix in preproc when indicator struct is shorter thanrecord struct

Поиск
Список
Период
Сортировка
От Rader, David
Тема [PATCH] ECPG bug fix in preproc when indicator struct is shorter thanrecord struct
Дата
Msg-id CAABt7R5qCGtzQe=suioG5OVWOA5jw2mvRx41VnxhBLgAvY6vKA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] ECPG bug fix in preproc when indicator struct isshorter than record struct
Список pgsql-hackers
Hello -

Attached is a proposed patch to fix a bug in the ECPG preprocessor that generates application code that core dumps at run-time. When the input pgc code uses a record struct for returning query results and uses an indicator struct that has fewer fields than the record struct, the generated .c code will compile with no warning but core dump. This situation comes up when a developer adds a field to an existing query, adds the field to the record struct and forgets to add the field to the indicator struct.

The patch fixes the generated code to use ECPGt_NO_INDICATOR in the call to ecpglib for indicator members that are not present and issues a compiler warning for either too few indicator members or too many indicator members.

The attached sample files are a simple sample of pgc code that can be used to see the difference in before and after generation and the before and after generated code.

If accepted, this bug fix can be back ported to earlier versions of ecpg as well.

Thanks
Dave


Вложения

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

Предыдущее
От: Chapman Flack
Дата:
Сообщение: Re: numeric regression test passes, but why?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Minor code improvement to estimate_path_cost_size in postgres_fdw