| От | Tomas Vondra |
|---|---|
| Тема | bogus assert in logicalmsg_desc |
| Дата | |
| Msg-id | b99b6101-2f14-3796-3dfa-4a6cd7d4326d@enterprisedb.com обсуждение исходный текст |
| Ответы |
Re: bogus assert in logicalmsg_desc
Re: bogus assert in logicalmsg_desc |
| Список | pgsql-hackers |
Hi,
while experimenting with logical messages, I ran into this assert in
logicalmsg_desc:
Assert(prefix[xlrec->prefix_size] != '\0');
This seems to be incorrect, because LogLogicalMessage does this:
xlrec.prefix_size = strlen(prefix) + 1;
So prefix_size includes the null byte, so the assert points out at the
first payload byte. And of course, the check should be "==" because we
expect the byte to be \0, not the other way around.
It's pretty simple to make this crash by writing a logical message where
the first payload byte is \0, e.g. like this:
select pg_logical_emit_message(true, 'a'::text, '\x00'::bytea);
and then running pg_waldump on the WAL segment.
Attached is a patch addressing this. This was added in 14, so we should
backpatch to that version.
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера