Re: "type with xxxx does not exist" when doing ExecMemoize()
Andrei Lepikhov <a.lepikhov@postgrespro.ru>
From: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
To: Tender Wang <tndrwang@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Richard Guo <guofenglinux@gmail.com>
Date: 2024-02-26T07:54:21Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- v3-0001-Store-Memoize-probeslot-values-in-the-hash-table-mem.patch (text/plain) patch v3-0001
On 26/2/2024 12:44, Tender Wang wrote: > > > Andrei Lepikhov <a.lepikhov@postgrespro.ru > <mailto:a.lepikhov@postgrespro.ru>> 于2024年2月26日周一 10:57写道: > > On 25/2/2024 20:32, Tender Wang wrote: > > I think in prepare_probe_slot(), should called datumCopy as the > attached > > patch does. > > > > Any thoughts? Thanks. > Thanks for the report. > I think it is better to invent a Runtime Memory Context; likewise, > it is > already designed in IndexScan and derivatives. Here, you just allocate > the value in some upper memory context. > Also, I'm curious why such a trivial error hasn't been found for a > long time > > > Make sense. I found MemoizeState already has a MemoryContext, so I used it. > I update the patch. This approach is better for me. In the next version of this patch, I included a test case. I am still unsure about the context chosen and the stability of the test case. Richard, you recently fixed some Memoize issues, could you look at this problem and patch? -- regards, Andrei Lepikhov Postgres Professional
Commits
-
Fix incorrect accessing of pfree'd memory in Memoize
- 72b8507db2cc 14.12 landed
- 74530804fcb7 15.7 landed
- 348233cb128d 16.3 landed
- e62984647225 17.0 landed
-
Fix memory leak in Memoize code
- 0b053e78b599 17.0 cited