Skip site navigation (1) Skip section navigation (2)

pgsql: Fix patternsel() and callers to do the right thing for NOT LIKE

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix patternsel() and callers to do the right thing for NOT LIKE
Date: 2007-11-07 21:00:44
Message-ID: 20071107210044.A8DE7754229@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        selfuncs.c (r1.214.2.6 -> r1.214.2.7)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.214.2.6&r2=1.214.2.7)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-11-07 22:37:24
Subject: pgsql: Improve the performance of LIKE/regex estimation in non-C
Previous:From: Tom LaneDate: 2007-11-07 21:00:37
Subject: pgsql: Fix patternsel() and callers to do the right thing for NOT LIKE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group