aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistutil.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-07-26 16:08:45 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-07-26 16:08:45 -0400
commit662d12aea1d697adc4896ff7e5d5cf398c0cd267 (patch)
tree65f474d13ba3a9bf9c1ac5e38714eac1eefbecc9 /src/backend/access/gist/gistutil.c
parent3acc4acd9bcbefbfaf789762950726c6208daf1b (diff)
downloadpostgresql-662d12aea1d697adc4896ff7e5d5cf398c0cd267.tar.gz
postgresql-662d12aea1d697adc4896ff7e5d5cf398c0cd267.zip
Avoid crash in eval_const_expressions if a Param's type changes.
Since commit 6719b238e it's been possible for the values of plpgsql record field variables to be exposed to the planner as Params. (Before that, plpgsql never supplied values for such variables during planning, so that the problematic code wasn't reached.) Other places that touch potentially-type-mutable Params either cope gracefully or do runtime-test-and-ereport checks that the type is what they expect. But eval_const_expressions() just had an Assert, meaning that it either failed the assertion or risked crashes due to using an incompatible value. In this case, rather than throwing an ereport immediately, we can just not perform a const-substitution in case of a mismatch. This seems important for the same reason that the Param fetch was speculative: we might not actually reach this part of the expression at runtime. Test case will follow in a separate commit. Patch by me, pursuant to bug report from Andrew Gierth. Back-patch to v11 where the previous commit appeared. Discussion: https://postgr.es/m/87wotkfju1.fsf@news-spur.riddles.org.uk
Diffstat (limited to 'src/backend/access/gist/gistutil.c')
0 files changed, 0 insertions, 0 deletions