]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix plan cache issue in PL/pgSQL CALL
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 5 Apr 2018 18:51:56 +0000 (14:51 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 5 Apr 2018 18:51:56 +0000 (14:51 -0400)
commitb9986551e0c6129300b9d7a387baf2006724b297
treedbb5abc11a64be98d0ad79470eea5b9ce9638fc5
parent6a5f796b48b0e9808fef9731da8aea17f56de999
Fix plan cache issue in PL/pgSQL CALL

If we are not going to save the plan, then we need to unset expr->plan
after we are done, also in error cases.  Otherwise, we get a dangling
pointer next time around.

This is not the ideal solution.  It would be better if we could convince
SPI not to associate a cached plan with a resource owner, and then we
could just save the plan in all cases.  But that would require bigger
surgery.

Reported-by: Pavel Stehule <pavel.stehule@gmail.com>
src/pl/plpgsql/src/expected/plpgsql_call.out
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/sql/plpgsql_call.sql