0002-remove-calc-not-flag.patch
text/x-diff
Filename: 0002-remove-calc-not-flag.patch
Type: text/x-diff
Part: 1
Patch
Format: unified
Series: patch 0002
| File | + | − |
|---|---|---|
| src/backend/utils/adt/tsginidx.c | 2 | 2 |
| src/backend/utils/adt/tsgistidx.c | 2 | 2 |
| src/backend/utils/adt/tsrank.c | 1 | 1 |
| src/backend/utils/adt/tsvector_op.c | 1 | 10 |
| src/include/tsearch/ts_utils.h | 0 | 5 |
diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c
index 3128f0a..b3e3ffc 100644
--- a/src/backend/utils/adt/tsginidx.c
+++ b/src/backend/utils/adt/tsginidx.c
@@ -248,7 +248,7 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS)
res = TS_execute(GETQUERY(query),
&gcv,
- TS_EXEC_CALC_NOT | TS_EXEC_PHRASE_NO_POS,
+ TS_EXEC_PHRASE_NO_POS,
checkcondition_gin);
}
@@ -286,7 +286,7 @@ gin_tsquery_triconsistent(PG_FUNCTION_ARGS)
if (TS_execute(GETQUERY(query),
&gcv,
- TS_EXEC_CALC_NOT | TS_EXEC_PHRASE_NO_POS,
+ TS_EXEC_PHRASE_NO_POS,
checkcondition_gin))
res = recheck ? GIN_MAYBE : GIN_TRUE;
}
diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c
index 927aed9..a601965 100644
--- a/src/backend/utils/adt/tsgistidx.c
+++ b/src/backend/utils/adt/tsgistidx.c
@@ -348,7 +348,7 @@ gtsvector_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(TS_execute(GETQUERY(query),
key,
- TS_EXEC_PHRASE_NO_POS | TS_EXEC_CALC_NOT,
+ TS_EXEC_PHRASE_NO_POS,
checkcondition_bit));
}
else
@@ -359,7 +359,7 @@ gtsvector_consistent(PG_FUNCTION_ARGS)
chkval.arre = chkval.arrb + ARRNELEM(key);
PG_RETURN_BOOL(TS_execute(GETQUERY(query),
(void *) &chkval,
- TS_EXEC_PHRASE_NO_POS | TS_EXEC_CALC_NOT,
+ TS_EXEC_PHRASE_NO_POS,
checkcondition_arr));
}
}
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c
index cbd97ab..c88ebfc 100644
--- a/src/backend/utils/adt/tsrank.c
+++ b/src/backend/utils/adt/tsrank.c
@@ -697,7 +697,7 @@ Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, CoverExt *ext)
fillQueryRepresentationData(qr, ptr);
if (TS_execute(GETQUERY(qr->query), (void *) qr,
- TS_EXEC_CALC_NOT, checkcondition_QueryOperand))
+ TS_EXEC_EMPTY, checkcondition_QueryOperand))
{
if (WEP_GETPOS(ptr->pos) < ext->p)
{
diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c
index 6df943a..2faba46 100644
--- a/src/backend/utils/adt/tsvector_op.c
+++ b/src/backend/utils/adt/tsvector_op.c
@@ -1627,13 +1627,6 @@ TS_phrase_execute(QueryItem *curitem, void *arg, uint32 flags,
* We need not touch data->width, since a NOT operation does not
* change the match width.
*/
- if (!(flags & TS_EXEC_CALC_NOT))
- {
- /* without CALC_NOT, report NOT as "match everywhere" */
- Assert(data->npos == 0 && !data->negate);
- data->negate = true;
- return TS_YES;
- }
switch (TS_phrase_execute(curitem + 1, arg, flags, chkcond, data))
{
case TS_NO:
@@ -1875,8 +1868,6 @@ TS_execute_recurse(QueryItem *curitem, void *arg, uint32 flags,
switch (curitem->qoperator.oper)
{
case OP_NOT:
- if (!(flags & TS_EXEC_CALC_NOT))
- return TS_YES;
switch (TS_execute_recurse(curitem + 1, arg, flags, chkcond))
{
case TS_NO:
@@ -2038,7 +2029,7 @@ ts_match_vq(PG_FUNCTION_ARGS)
chkval.operand = GETOPERAND(query);
result = TS_execute(GETQUERY(query),
&chkval,
- TS_EXEC_CALC_NOT,
+ TS_EXEC_EMPTY,
checkcondition_str);
PG_FREE_IF_COPY(val, 0);
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index 609b0c7..9ff9fcf 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -183,11 +183,6 @@ typedef TSTernaryValue (*TSExecuteCallback) (void *arg, QueryOperand *val,
*/
#define TS_EXEC_EMPTY (0x00)
/*
- * If TS_EXEC_CALC_NOT is not set, then NOT expressions are automatically
- * evaluated to be true. Useful in cases where NOT isn't important (ranking).
- */
-#define TS_EXEC_CALC_NOT (0x01)
-/*
* If TS_EXEC_PHRASE_NO_POS is set, allow OP_PHRASE to be executed lossily
* in the absence of position information: a true result indicates that the
* phrase might be present. Without this flag, OP_PHRASE always returns