Fix a typo of func DecodeInsert()

Started by Yongtao Huangabout 2 years ago4 messageshackers
Jump to latest
#1Yongtao Huang
yongtaoh2022@gmail.com

Hi all,
I think the comment above the function DecodeInsert()
in src/backend/replication/logical/decode.c should be
+ * *Inserts *can contain the new tuple.
, rather than
- * *Deletes *can contain the new tuple.

Please correct me if I'm wrong, thanks a lot.

Attachments:

0001-Fix-a-typo-of-func-DecodeInsert.patchapplication/octet-stream; name=0001-Fix-a-typo-of-func-DecodeInsert.patchDownload+1-2
#2Richard Guo
guofenglinux@gmail.com
In reply to: Yongtao Huang (#1)
Re: Fix a typo of func DecodeInsert()

On Wed, Jan 17, 2024 at 8:47 AM Yongtao Huang <yongtaoh2022@gmail.com>
wrote:

Hi all,
I think the comment above the function DecodeInsert()
in src/backend/replication/logical/decode.c should be
+ * *Inserts *can contain the new tuple.
, rather than
- * *Deletes *can contain the new tuple.

Nice catch. +1.

I kind of wonder if it would be clearer to state that "XLOG_HEAP_INSERT
can contain the new tuple", in order to differentiate it from
XLOG_HEAP2_MULTI_INSERT.

Thanks
Richard

#3Yongtao Huang
yongtaoh2022@gmail.com
In reply to: Richard Guo (#2)
Re: Fix a typo of func DecodeInsert()

Thank you. I prefer to keep the comments of these three functions
*DecodeInsert()*, *DecodeUpdate()*, and *DecodeDelete()* aligned.
```
/*
* Parse XLOG_HEAP_INSERT (not MULTI_INSERT!) records into tuplebufs.
*
* Inserts can contain the new tuple.
*/
static void
DecodeInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)

/*
* Parse XLOG_HEAP_UPDATE and XLOG_HEAP_HOT_UPDATE, which have the same
layout
* in the record, from wal into proper tuplebufs.
*
* Updates can possibly contain a new tuple and the old primary key.
*/
static void
DecodeUpdate(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)

/*
* Parse XLOG_HEAP_DELETE from wal into proper tuplebufs.
*
* Deletes can possibly contain the old primary key.
*/
static void
DecodeDelete(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)

```

Best wishes

Yongtao Huang

Richard Guo <guofenglinux@gmail.com> 于2024年1月17日周三 09:10写道:

Show quoted text

On Wed, Jan 17, 2024 at 8:47 AM Yongtao Huang <yongtaoh2022@gmail.com>
wrote:

Hi all,
I think the comment above the function DecodeInsert()
in src/backend/replication/logical/decode.c should be
+ * *Inserts *can contain the new tuple.
, rather than
- * *Deletes *can contain the new tuple.

Nice catch. +1.

I kind of wonder if it would be clearer to state that "XLOG_HEAP_INSERT
can contain the new tuple", in order to differentiate it from
XLOG_HEAP2_MULTI_INSERT.

Thanks
Richard

#4Michael Paquier
michael@paquier.xyz
In reply to: Yongtao Huang (#3)
Re: Fix a typo of func DecodeInsert()

On Wed, Jan 17, 2024 at 12:18:12PM +0800, Yongtao Huang wrote:

Thank you. I prefer to keep the comments of these three functions
*DecodeInsert()*, *DecodeUpdate()*, and *DecodeDelete()* aligned.

Not sure either what we would gain with a more complicated description
in this area knowing that there is also DecodeMultiInsert(), so I have
just fixed the top of DecodeInsert() as you have suggested as it is
clearly wrong. Thanks.
--
Michael