Re: Pg18 Recursive Crash
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, Paul Ramsey <pramsey@cleverelephant.ca>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-18T22:21:27Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Optimize grouping equality checks with virtual slots
- 08cdb079d4a8 18.0 landed
-
Fix Assert failure in WITH RECURSIVE UNION queries
- 2c7887c9d612 13.19 landed
- bdb07d24113b 14.16 landed
- ef178d38bb49 15.11 landed
- 093fc156b0ef 16.7 landed
- 7b8d45d278de 17.3 landed
- 8f4ee962691e 18.0 landed
-
Fix incorrect slot type in BuildTupleHashTableExt
- d96d1d5152f3 18.0 landed
Attachments
- v1-0001-Fix-Assert-failure-in-WITH-RECURSIVE-UNION-querie.patch (application/octet-stream) patch v1-0001
On Wed, 18 Dec 2024 at 23:45, David Rowley <dgrowleyml@gmail.com> wrote: > Maybe we need to backpatch passing NULL instead of &TTSOpsMinimalTuple > to ExecBuildGroupingEqual() in BuildTupleHashTableExt(). Something > like the attached patch. I've attached a more formal patch for this and I've also now done a bit more research and experimentation as to why we didn't notice this for so long. It looks like the non-recursive part of the UNION must use TTSOpsBufferHeapTuple and there must be duplicates. So that basically means you need to select all columns, otherwise, there'd be projection and the slot would be virtual. That boils down to, you need a table without a primary key or any unique constraints, otherwise, you can't get the duplicate value that's required to trigger the Assert failure. I hope the proposed commit message is enough to explain this in enough detail. Of course, there may maybe some other path to trigger this using one of the other users of BuildTupleHashTableExt(). I propose to quickly do a master-only follow-up commit to use the inputOps instead of NULL in BuildTupleHashTableExt (Basically Tom's patch from [1]) Sound ok? David [1] https://postgr.es/m/2543667.1734483723@sss.pgh.pa.us