postgresql/src/backend
Tom Lane 5e63a6f434 Fix parsing of ignored operators in websearch_to_tsquery().
The manual says clearly that punctuation in the input of
websearch_to_tsquery() is ignored, except for the special cases
of dashes and quotes.  However, this failed for cases like
"(foo bar) or something", or in general an ISOPERATOR character
in front of the "or".  We'd switch back to WAITOPERAND state,
then ignore the operator character while remaining in that state,
and then reach the "or" in WAITOPERAND state which (intentionally)
makes us treat it as data.

The fix is simple enough: if we see an ISOPERATOR character while in
WAITOPERATOR state, we have to skip it while staying in that state.
(We don't need to worry about other punctuation characters: those will
be consumed as though they were words, but then rejected by lexizing.)

In v14 and up (since commit eb086056f) we can simplify the code a bit
more too, because there is no longer a reason for the WAITOPERAND
state to distinguish between quoted and unquoted operands.

Per bug #18479 from Manos Emmanouilidis.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18479-d9b46e2fc242c33e@postgresql.org
2024-06-13 20:34:43 -04:00
..
access Clamp result of MultiXactMemberFreezeThreshold 2024-06-13 19:03:00 +03:00
bootstrap Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
catalog Fix confusion about the return rowtype of SQL-language procedures. 2024-03-12 18:16:10 -04:00
commands Reject modifying a temp table of another session with ALTER TABLE. 2024-06-07 14:50:09 -04:00
executor Fix behavior of stable functions called from a CALL's argument list. 2024-06-07 13:27:26 -04:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Fix illegal attribute propagation in LLVM JIT. 2024-04-10 12:15:59 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 15:51:47 +12:00
libpq Disconnect if socket cannot be put into non-blocking mode 2024-03-12 10:18:54 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:42 +09:00
nodes Further fixes for MULTIEXPR_SUBLINK fix. 2022-09-06 16:38:18 -04:00
optimizer Fix infer_arbiter_indexes() to not assume resultRelation is 1. 2024-06-11 17:57:46 -04:00
parser Fix type-checking of RECORD-returning functions in FROM, redux. 2024-04-15 12:56:56 -04:00
partitioning Fix incorrect pruning of NULL partition for boolean IS NOT clauses 2024-02-20 12:51:38 +13:00
po Translation updates 2024-05-06 12:15:05 +02:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Avoid deadlock during orphan temp table removal. 2024-04-02 14:59:04 -04:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:21:04 -07:00
replication Revert "Skip .DS_Store files in server side utils" 2024-02-13 14:08:56 +01:00
rewrite Disallow converting a table to a view within an outer SQL command. 2024-04-30 15:22:56 -04:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:19:26 +13:00
storage Fix WaitEventSet resource leak in WaitLatchOrSocket(). 2024-04-11 19:05:07 +09:00
tcop Be more rigorous about local variables in PostgresMain(). 2023-07-10 12:14:34 -04:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Fix parsing of ignored operators in websearch_to_tsquery(). 2024-06-13 20:34:43 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2020-08-10 15:21:18 +02:00