Re: pgsql: Add GUC to enable compression of full page images stored in WAL.

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: pgsql: Add GUC to enable compression of full page images stored in WAL.
Дата
Msg-id CAHGQGwHtSweb4V5dXa-NCbOV+NhOBwiHVbKaVKMqM=02-j_Q3w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Add GUC to enable compression of full page images stored in WAL.  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: pgsql: Add GUC to enable compression of full page images stored in WAL.  (Michael Paquier <michael.paquier@gmail.com>)
Re: pgsql: Add GUC to enable compression of full page images stored in WAL.  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-committers
On Wed, Mar 11, 2015 at 11:30 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Wed, Mar 11, 2015 at 11:18 PM, Andres Freund <andres@2ndquadrant.com> wrote:
>> On 2015-03-11 06:54:16 +0000, Fujii Masao wrote:
>>> Add GUC to enable compression of full page images stored in WAL.
>>
>> This triggers a couple warnings here (gcc 4.9 and 5):
>>
>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c: In function 'XLogInsert':
>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:670:5: warning: 'cbimg.hole_length' may be used
uninitializedin this function [-Wmaybe-uninitialized] 
>>      memcpy(scratch, &cbimg,
>>      ^
>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:494:33: note: 'cbimg.hole_length' was declared
here
>>    XLogRecordBlockCompressHeader cbimg;
>>                                  ^
>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:668:20: warning: 'hole_length' may be used
uninitializedin this function [-Wmaybe-uninitialized] 
>>     if (hole_length != 0 && is_compressed)
>>                     ^
>> /home/andres/src/postgresql/src/backend/access/transam/xloginsert.c:497:10: note: 'hole_length' was declared here
>>    uint16 hole_length;
>>
>> I've not checked whether they're spurious or not.

Thanks for the report! We can suppress those warnings just by
initializing cbimg.hole_length and hole_length. But I'd like to apply
the attached patch which not only initializes the variable but also
refactors the related code.

Regards,

--
Fujii Masao

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Support flattening of empty-FROM subqueries and one-row VALUES t
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix memory leaks in GIN index vacuum.