diff options
author | Robert Haas | 2018-01-26 14:51:15 +0000 |
---|---|---|
committer | Robert Haas | 2018-01-26 14:56:33 +0000 |
commit | b0313f9cc8f54d6a5c12f8987c9b6afa0a5bbced (patch) | |
tree | baea26c3f392bb66b5b08aee579042580f41af23 /contrib/pageinspect/hashfuncs.c | |
parent | c1869542b3a4da4b12cace2253ef177da761c00d (diff) |
pageinspect: Fix use of wrong memory context by hash_page_items.
This can cause it to produce incorrect output.
Report and patch by Masahiko Sawada.
Discussion: http://postgr.es/m/CAD21AoBc5Asx7pXdUWu6NqU_g=Ysn95EGL9SMeYhLLduYoO_OA@mail.gmail.com
Diffstat (limited to 'contrib/pageinspect/hashfuncs.c')
-rw-r--r-- | contrib/pageinspect/hashfuncs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c index 3d0e3f9757e..99b61b8669f 100644 --- a/contrib/pageinspect/hashfuncs.c +++ b/contrib/pageinspect/hashfuncs.c @@ -313,10 +313,10 @@ hash_page_items(PG_FUNCTION_ARGS) fctx = SRF_FIRSTCALL_INIT(); - page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE); - mctx = MemoryContextSwitchTo(fctx->multi_call_memory_ctx); + page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE); + uargs = palloc(sizeof(struct user_args)); uargs->page = page; |