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

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix patternsel() and callers to do the right thing for NOT LIKE
Дата
Msg-id 20071107210037.8FBB9754229@cvs.postgresql.org
обсуждение исходный текст
Список 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.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        selfuncs.c (r1.236 -> r1.237)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.236&r2=1.237)

В списке pgsql-committers по дате отправления:

Предыдущее
От: petere@postgresql.org (Peter Eisentraut)
Дата:
Сообщение: pgsql: cannot be used here, because psql doesn't handle it.
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix patternsel() and callers to do the right thing for NOT LIKE