Trivial comment fix for tsquerysend()

Started by Emre Hasegeli10 months ago4 messages
#1Emre Hasegeli
emre@hasegeli.com
1 attachment(s)

Patch is attached.

Attachments:

0001-Fix-comment-of-tsquerysend.patchapplication/octet-stream; name=0001-Fix-comment-of-tsquerysend.patchDownload
From 25f3053e8132943fb4d2b811e8350a15e1cf6e15 Mon Sep 17 00:00:00 2001
From: Emre Hasegeli <emre@hasegeli.com>
Date: Thu, 6 Mar 2025 10:23:20 +0100
Subject: [PATCH] Fix comment of tsquerysend()

---
 src/backend/utils/adt/tsquery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c
index b1bad7bd60c..717de8073d5 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -1169,24 +1169,25 @@ tsqueryout(PG_FUNCTION_ARGS)
 /*
  * Binary Input / Output functions. The binary format is as follows:
  *
  * uint32	 number of operators/operands in the query
  *
  * Followed by the operators and operands, in prefix notation. For each
  * operand:
  *
  * uint8	type, QI_VAL
  * uint8	weight
- *			operand text in client encoding, null-terminated
  * uint8	prefix
+ *			operand text in client encoding, null-terminated
  *
  * For each operator:
+ *
  * uint8	type, QI_OPR
  * uint8	operator, one of OP_AND, OP_PHRASE OP_OR, OP_NOT.
  * uint16	distance (only for OP_PHRASE)
  */
 Datum
 tsquerysend(PG_FUNCTION_ARGS)
 {
 	TSQuery		query = PG_GETARG_TSQUERY(0);
 	StringInfoData buf;
 	int			i;
-- 
2.48.1

#2Aleksander Alekseev
aleksander@timescale.com
In reply to: Emre Hasegeli (#1)
Re: Trivial comment fix for tsquerysend()

Hi Emre,

Patch is attached.

I looked very closely and failed to understand what this patch fixes /
improves exactly. Maybe you could elaborate a bit?

--
Best regards,
Aleksander Alekseev

#3Emre Hasegeli
emre@hasegeli.com
In reply to: Aleksander Alekseev (#2)
Re: Trivial comment fix for tsquerysend()

I looked very closely and failed to understand what this patch fixes /
improves exactly. Maybe you could elaborate a bit?

Sorry.

The order of the "operand text" is wrong in the comments. It's sent
after the "prefix".

#4Álvaro Herrera
alvherre@kurilemu.de
In reply to: Emre Hasegeli (#1)
Re: Trivial comment fix for tsquerysend()

Hello,

On 2025-Mar-06, Emre Hasegeli wrote:

Patch is attached.

Looks correct to me. It's harmless obviously (and nobody appears to
have been damanged by it) but I still backpatched to all live branches.
Thanks, Emre.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"No hay ausente sin culpa ni presente sin disculpa" (Prov. francés)