pgsql-io / multicorn2

http://multicorn2.org
Other
83 stars 17 forks source link

Fix crash conditions in EXPLAIN #54

Closed mfenniak closed 4 months ago

mfenniak commented 4 months ago

Fixes #53. Avoids running ExecInitExpr and ExecEvalExpr on the RHS of a query qual when performing EXPLAIN queries.

This could be a behavior change in the explain() function, as there would have been cases where EXPLAIN would receive a Qual with as specific value during an explain before, and now it will always receive None for the value. However there were also already cases where None would be received as a value; an argument could be made that this makes it consistent and easier to identify and test. I imagine it would be possible to identify whether it is safe to evaluate the parameter or not, but I don't know how.

I'm planning to finish a little testing to verify this fixes the crash in a real-world FDW without any negative side-effects before merging.