From 18a1cbeb330571b027ed4cbf3e0a686f71ef1ffb Mon Sep 17 00:00:00 2001 From: Bvsk Patnaik Date: Tue, 10 Dec 2024 10:53:22 -0800 Subject: [PATCH] [#25230] YSQL: Fix style in copyfrom.c Summary: Fix leading whitespace to resolve linter errors. Purely a stylistic change. Jira: DB-14419 Test Plan: Jenkins: compile only Reviewers: jason Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D40589 --- src/postgres/src/backend/commands/copy.c | 3 +-- src/postgres/src/backend/commands/copyfrom.c | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/postgres/src/backend/commands/copy.c b/src/postgres/src/backend/commands/copy.c index 4fedafc9e179..e80b1a4f86e9 100644 --- a/src/postgres/src/backend/commands/copy.c +++ b/src/postgres/src/backend/commands/copy.c @@ -129,9 +129,8 @@ DoCopy(ParseState *pstate, const CopyStmt *stmt, rel = table_openrv(stmt->relation, lockmode); if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - IsYugaByteEnabled()) { + IsYugaByteEnabled()) SetTxnWithPGRel(); - } relid = RelationGetRelid(rel); diff --git a/src/postgres/src/backend/commands/copyfrom.c b/src/postgres/src/backend/commands/copyfrom.c index 02dab64ce480..b19f4f82b0b9 100644 --- a/src/postgres/src/backend/commands/copyfrom.c +++ b/src/postgres/src/backend/commands/copyfrom.c @@ -740,12 +740,12 @@ CopyFrom(CopyFromState cstate) Assert(resultRelInfo->ri_RelationDesc->rd_rel->relpersistence == RELPERSISTENCE_TEMP || resultRelInfo->ri_RelationDesc->rd_rel->relkind == RELKIND_FOREIGN_TABLE); ereport(WARNING, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("Batched COPY is not supported on %s tables. " - "Defaulting to using one transaction for the entire copy.", - YbIsTempRelation(resultRelInfo->ri_RelationDesc) ? "temporary" : "foreign"), - errhint("Either copy onto non-temporary table or set rows_per_transaction " - "option to `0` to disable batching and remove this warning."))); + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("Batched COPY is not supported on %s tables. " + "Defaulting to using one transaction for the entire copy.", + YbIsTempRelation(resultRelInfo->ri_RelationDesc) ? "temporary" : "foreign"), + errhint("Either copy onto non-temporary table or set rows_per_transaction " + "option to `0` to disable batching and remove this warning."))); } else if (YBIsDataSent()) ereport(WARNING, @@ -758,11 +758,11 @@ CopyFrom(CopyFromState cstate) else if (HasNonRITrigger(cstate->rel->trigdesc)) ereport(WARNING, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("Batched COPY is not supported on table with non RI trigger. " + errmsg("Batched COPY is not supported on table with non RI trigger. " "Defaulting to using one transaction for the entire copy."), errhint("Set rows_per_transaction option to `0` to disable batching " - "and remove this warning."))); - else + "and remove this warning."))); + else batch_size = cstate->opts.batch_size; cstate->opts.batch_size = batch_size; @@ -1298,9 +1298,9 @@ CopyFrom(CopyFromState cstate) if (cstate->opts.batch_size > 0) { - /* + /* * Handle queued AFTER triggers before committing. If there are errors, - * do not commit the current batch. + * do not commit the current batch. */ AfterTriggerEndQuery(estate);