(unnamed)

text/html

Filename: (unnamed)
Type: text/html
Part: 0
Message: Re: [PATCH] Optionally record Plan IDs to track plan changes for a query
<div><div><div><div><div>Dear PostgreSQL Hackers,</div><div> </div><div>I’d like to propose a follow-up fix for a crash caused by jumbling of empty</div><div>array fields in Plan structures that was introduced in the v5-0003 patch.</div><div> </div><div>For your convenience, I attached a minimal reproducible example:</div><div>```</div><div>create table foo as select i as num from generate_series(1, 1000) i;</div><div>set compute_plan_id to true;</div><div> </div><div>-- server closed the connection unexpectedly</div><div>explain (costs off, verbose)</div><div>select min(num) from foo;</div><div>```</div><div>In this case the scalar aggregate operator `min(num)` is expressed as an Agg</div><div>node with an empty array of GROUP BY attributes. The jumble logic can’t handle</div><div>emptiness and terminates the backend. Similar behavior could happen during</div><div>jumbling an arbitrary plan node which contains an array.</div><div> </div><div>Patchset overview:</div><div>v6-0001</div><div>-----------</div><div>Aggregates changes from v5-0001..v5-0003 and rebases onto master</div><div>commit b39013b7b1b116b5d9be51f0919b472b58b3a28d.</div><div> </div><div>v6-0002</div><div>-----------</div><div>Fixes the lack of empty-array handling during jumbling (originally applies on</div><div>top of v6-0000). For anyone testing on the v5 versions, v6-0001 can be easily</div><div>applied on top of v5-0003.</div><div> </div><div>--</div><div>Sincerely, Andrey Kazachkov</div></div></div></div></div>