Remove a unnecessary backslash in CopyFrom

Started by Yugo Nagataabout 1 year ago4 messages
#1Yugo Nagata
nagata@sraoss.co.jp
1 attachment(s)

Hi,

I found a unnecessary backslash in CopyFrom().

if (cstate->opts.reject_limit > 0 && \
cstate->num_errors > cstate->opts.reject_limit)

It can be removed because this is not in a macro.
I've attached a patch.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

remove_a_unnecessary_backslash.patchtext/x-diff; name=remove_a_unnecessary_backslash.patchDownload
diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index 07cbd5d22b..754cb49616 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -1018,7 +1018,7 @@ CopyFrom(CopyFromState cstate)
 			pgstat_progress_update_param(PROGRESS_COPY_TUPLES_SKIPPED,
 										 cstate->num_errors);
 
-			if (cstate->opts.reject_limit > 0 && \
+			if (cstate->opts.reject_limit > 0 &&
 				cstate->num_errors > cstate->opts.reject_limit)
 				ereport(ERROR,
 						(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
#2Tender Wang
tndrwang@gmail.com
In reply to: Yugo Nagata (#1)
Re: Remove a unnecessary backslash in CopyFrom

Yugo Nagata <nagata@sraoss.co.jp> 于2024年11月12日周二 10:46写道:

Hi,

I found a unnecessary backslash in CopyFrom().

if (cstate->opts.reject_limit > 0 && \
cstate->num_errors > cstate->opts.reject_limit)

It can be removed because this is not in a macro.
I've attached a patch.

Yeah, agree. The patch LGTM.

--
Thanks,
Tender Wang

#3Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Tender Wang (#2)
Re: Remove a unnecessary backslash in CopyFrom

On 2024/11/12 11:58, Tender Wang wrote:

Yugo Nagata <nagata@sraoss.co.jp <mailto:nagata@sraoss.co.jp>> 于2024年11月12日周二 10:46写道:

Hi,

I found a unnecessary backslash in CopyFrom().

            if (cstate->opts.reject_limit > 0 && \
                cstate->num_errors > cstate->opts.reject_limit)

It can be removed because this is not in a macro.
I've attached a patch.

Yeah, agree. The patch LGTM.

Thanks for the report and patch! This is a mistake in commit 4ac2a9bece.
I'll commit the patch.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

#4Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Fujii Masao (#3)
Re: Remove a unnecessary backslash in CopyFrom

On 2024/11/12 12:31, Fujii Masao wrote:

On 2024/11/12 11:58, Tender Wang wrote:

Yugo Nagata <nagata@sraoss.co.jp <mailto:nagata@sraoss.co.jp>> 于2024年11月12日周二 10:46写道:

    Hi,

    I found a unnecessary backslash in CopyFrom().

                 if (cstate->opts.reject_limit > 0 && \
                     cstate->num_errors > cstate->opts.reject_limit)

    It can be removed because this is not in a macro.
    I've attached a patch.

Yeah, agree. The patch LGTM.

Thanks for the report and patch! This is a mistake in commit 4ac2a9bece.
I'll commit the patch.

Pushed. Thanks!

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION