Skip to content

Commit

Permalink
[#25230] YSQL: Fix style in copyfrom.c
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pao214 committed Dec 17, 2024
1 parent 4bf9d89 commit 18a1cbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/postgres/src/backend/commands/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
22 changes: 11 additions & 11 deletions src/postgres/src/backend/commands/copyfrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 18a1cbe

Please sign in to comment.