]> granicus.if.org Git - postgresql/commit
Fix patternsel() and callers to do the right thing for NOT LIKE and the other
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Nov 2007 21:00:44 +0000 (21:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Nov 2007 21:00:44 +0000 (21:00 +0000)
commit69946e80adc2b006980af3f4167fc9f35676cbb1
treec842009078a00a84c498576bcddc3958614ebca7
parent635372ebc06e91e0d4d1566135e1419deb86c8a3
Fix patternsel() and callers to do the right thing for NOT LIKE and the other
negated-match operators.  patternsel had been using the supplied operator as
though it were a positive-match operator, and thus obtaining a wrong result,
which was even more wrong after the caller subtracted it from 1.  Seems
cleanest to give patternsel an explicit "negate" argument so that it knows
what's going on.  Also install the same factorization scheme for pattern
join selectivity estimators; even though they are just stubs at the
moment, this may keep someone from making the same type of mistake when
they get filled out.  Per report from Greg Mullane.

Backpatch to 8.2 --- previous releases do not show the problem because
patternsel() doesn't actually use the operator directly.
src/backend/utils/adt/selfuncs.c