stats_ext test fails with -DCATCACHE_FORCE_RELEASE

Поиск
Список
Период
Сортировка
От Amit Langote
Тема stats_ext test fails with -DCATCACHE_FORCE_RELEASE
Дата
Msg-id 1349aabb-3a1f-6675-9fc0-65e2ce7491dd@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: stats_ext test fails with -DCATCACHE_FORCE_RELEASE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi.

While playing around with a -DCATCACHE_FORCE_RELEASE build, I noticed that
stats_ext test failed with errors for multiple statements that looked like
this:

ERROR:  invalid ndistinct magic 7f7f7f7f (expected a352bfa4)

I figured it's because statext_dependencies_load() and
statext_ndistinct_build() both return a pointer that points directly into
a pg_statistics_ext tuple obtained by using SearchSysCache1 that has
uncertain lifetime after subsequent call to ReleaseSysCache before returning.

I think we should be calling statext_dependencies_deserialize() and
statext_ndistinct_deserialize(), respectively, *before* we perform
ReleaseSysCache on the tuple.  Attached patch does that.

Thanks,
Amit

Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: A few warnings on Windows
Следующее
От: "Liran's Lab"
Дата:
Сообщение: Protecting sensitive data over NetApp