Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldGSl-0008KS-Qp for pgsql-hackers@arkaria.postgresql.org; Sun, 02 May 2021 18:05:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ldGSk-0001Mo-Fc for pgsql-hackers@arkaria.postgresql.org; Sun, 02 May 2021 18:05:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldGSk-0001Mh-92 for pgsql-hackers@lists.postgresql.org; Sun, 02 May 2021 18:05:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldGSg-0003Df-CV for pgsql-hackers@lists.postgresql.org; Sun, 02 May 2021 18:05:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 142I4u4K3712829; Sun, 2 May 2021 14:04:56 -0400 From: Tom Lane To: Alexander Korotkov cc: PostgreSQL Hackers , Valentin Gatien-Baron , Teodor Sigaev , Oleg Bartunov Subject: Re: websearch_to_tsquery() returns queries that don't match to_tsvector() In-reply-to: References: <3712260.1619977947@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Sun, 02 May 2021 20:57:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3712827.1619978696.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 02 May 2021 14:04:56 -0400 Message-ID: <3712828.1619978696@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > Ooops, I've included this by oversight. The next revision is attached. > Anything besides that? Some quick eyeball review: + /* Everything is quotes is processed as a single token */ Should read "Everything in quotes ..." - /* or else gettoken_tsvector() will raise an error */ + /* or else ƒtsvector() will raise an error */ Looks like an unintentional change? @@ -846,7 +812,6 @@ parse_tsquery(char *buf, state.buffer = buf; state.buf = buf; state.count = 0; - state.in_quotes = false; state.state = WAITFIRSTOPERAND; state.polstr = NIL; This change seems wrong/unsafe too. regards, tom lane