Re: pg_stat_statements: add missing tests for nesting_level
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: pg_stat_statements: add missing tests for nesting_level |
| Дата | |
| Msg-id | aXXJIorDJDdxReF9@paquier.xyz обсуждение исходный текст |
| Ответ на | Re: pg_stat_statements: add missing tests for nesting_level (Alexander Lakhin <exclusion@gmail.com>) |
| Ответы |
Re: pg_stat_statements: add missing tests for nesting_level
|
| Список | pgsql-hackers |
On Sun, Jan 25, 2026 at 08:00:00AM +0200, Alexander Lakhin wrote: > I can reproduce this locally with no extra tricks. Could you please adjust > the test for this mode? Reproduced here. That was trickier than it looks. A trick with debug_discard_caches cannot help, because with a CLOBBER_CACHE_ALWAYS build we would still do a GetCachedPlan() -> RevalidateCachedQuery() that goes through the post-parse analyze hook where the query would still be normalized, showing up in the output anyway. So I have come up with a plan B. If we do a DISCARD PLANS before the *first* function call, we can force the test to revalidate the cached query without caring about CLOBBER_CACHE_ALWAYS, meaning that we would always store a normalized version of the inner query. The point of the test is to check after the nesting level calculation in the planner hook, and the test is still able to check that correctly. If I remove the nesting_level bits from the code while the DISCARD is around, the entry is stored as a top level entry incorrectly, but it should be stored as toplevel=false. I'll go apply the attached shortly, after some more checks.. -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера