Fix an oversight I made in a cleanup patch over a year ago:

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 6b73d7e5676298fe7891014adc56a0a32c807117
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-04-01T00:48:33Z
Releases: 8.4.0
Fix an oversight I made in a cleanup patch over a year ago:
eval_const_expressions needs to be passed the PlannerInfo ("root") structure,
because in some cases we want it to substitute values for Param nodes.
(So "constant" is not so constant as all that ...)  This mistake partially
disabled optimization of unnamed extended-Query statements in 8.3: in
particular the LIKE-to-indexscan optimization would never be applied if the
LIKE pattern was passed as a parameter, and constraint exclusion depending
on a parameter value didn't work either.

Files