From fb5e63ce573023e8fd700b8213246e8b828ff5b3 Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Fri, 27 Aug 2021 09:46:08 +0300 Subject: [PATCH] Fix style --- src/backend/columnar/columnar_tableam.c | 1 - .../distributed/commands/dependencies.c | 4 ++- src/backend/distributed/commands/function.c | 6 ++-- .../distributed/commands/local_multi_copy.c | 6 ++-- src/backend/distributed/commands/multi_copy.c | 28 +++++++++---------- .../distributed/executor/multi_executor.c | 4 +-- src/backend/distributed/metadata/distobject.c | 8 ++++-- .../udfs/citus_finish_pg_upgrade/10.2-1.sql | 2 +- .../udfs/citus_finish_pg_upgrade/latest.sql | 2 +- .../distributed/utils/function_utils.c | 2 +- .../distributed/commands/utility_hook.h | 2 +- src/test/regress/Makefile | 2 +- src/test/regress/expected/.gitignore | 1 + src/test/regress/expected/tablespace.out | 5 ---- src/test/regress/input/tablespace.source | 2 +- src/test/regress/sql/.gitignore | 1 + src/test/regress/sql/tablespace.sql | 5 ---- 17 files changed, 39 insertions(+), 42 deletions(-) delete mode 100644 src/test/regress/expected/tablespace.out delete mode 100644 src/test/regress/sql/tablespace.sql diff --git a/src/backend/columnar/columnar_tableam.c b/src/backend/columnar/columnar_tableam.c index 7428e747d..495838833 100644 --- a/src/backend/columnar/columnar_tableam.c +++ b/src/backend/columnar/columnar_tableam.c @@ -1935,7 +1935,6 @@ ColumnarProcessUtility(PlannedStmt *pstmt, DestReceiver *dest, QueryCompletionCompat *completionTag) { - #if PG_VERSION_NUM >= PG_VERSION_14 if (readOnlyTree) { diff --git a/src/backend/distributed/commands/dependencies.c b/src/backend/distributed/commands/dependencies.c index 8561ad4df..16dbeda32 100644 --- a/src/backend/distributed/commands/dependencies.c +++ b/src/backend/distributed/commands/dependencies.c @@ -251,7 +251,9 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency) */ Assert(false); ereport(ERROR, (errmsg("unsupported object %s for distribution by citus", - getObjectTypeDescription_compat(dependency, /* missingOk: */ false)), + getObjectTypeDescription_compat(dependency, + + /* missingOk: */ false)), errdetail( "citus tries to recreate an unsupported object on its workers"), errhint("please report a bug as this should not be happening"))); diff --git a/src/backend/distributed/commands/function.c b/src/backend/distributed/commands/function.c index e6a646735..c6e9a3519 100644 --- a/src/backend/distributed/commands/function.c +++ b/src/backend/distributed/commands/function.c @@ -1613,7 +1613,7 @@ PreprocessAlterFunctionDependsStmt(Node *node, const char *queryString, * workers */ - const char *functionName = + const char *functionName = getObjectIdentity_compat(&address, /* missingOk: */ false); ereport(ERROR, (errmsg("distrtibuted functions are not allowed to depend on an " "extension"), @@ -1933,9 +1933,9 @@ ErrorIfFunctionDependsOnExtension(const ObjectAddress *functionAddress) if (IsObjectAddressOwnedByExtension(functionAddress, &extensionAddress)) { - char *functionName = + char *functionName = getObjectIdentity_compat(functionAddress, /* missingOk: */ false); - char *extensionName = + char *extensionName = getObjectIdentity_compat(&extensionAddress, /* missingOk: */ false); ereport(ERROR, (errmsg("unable to create a distributed function from functions " "owned by an extension"), diff --git a/src/backend/distributed/commands/local_multi_copy.c b/src/backend/distributed/commands/local_multi_copy.c index 12b53e90a..fbfce7119 100644 --- a/src/backend/distributed/commands/local_multi_copy.c +++ b/src/backend/distributed/commands/local_multi_copy.c @@ -212,9 +212,9 @@ DoLocalCopy(StringInfo buffer, Oid relationId, int64 shardId, CopyStmt *copyStat (void) addRangeTableEntryForRelation(pState, shard, AccessShareLock, NULL, false, false); CopyFromState cstate = BeginCopyFrom_compat(pState, shard, NULL, NULL, false, - ReadFromLocalBufferCallback, - copyStatement->attlist, - copyStatement->options); + ReadFromLocalBufferCallback, + copyStatement->attlist, + copyStatement->options); CopyFrom(cstate); EndCopyFrom(cstate); diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index ed616780c..32a6fde6a 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -524,13 +524,13 @@ CopyToExistingShards(CopyStmt *copyStatement, QueryCompletionCompat *completionT /* initialize copy state to read from COPY data source */ CopyFromState copyState = BeginCopyFrom_compat(NULL, - copiedDistributedRelation, - NULL, - copyStatement->filename, - copyStatement->is_program, - NULL, - copyStatement->attlist, - copyStatement->options); + copiedDistributedRelation, + NULL, + copyStatement->filename, + copyStatement->is_program, + NULL, + copyStatement->attlist, + copyStatement->options); /* set up callback to identify error line number */ errorCallback.callback = CopyFromErrorCallback; @@ -622,13 +622,13 @@ CopyToNewShards(CopyStmt *copyStatement, QueryCompletionCompat *completionTag, O /* initialize copy state to read from COPY data source */ CopyFromState copyState = BeginCopyFrom_compat(NULL, - distributedRelation, - NULL, - copyStatement->filename, - copyStatement->is_program, - NULL, - copyStatement->attlist, - copyStatement->options); + distributedRelation, + NULL, + copyStatement->filename, + copyStatement->is_program, + NULL, + copyStatement->attlist, + copyStatement->options); CopyOutState copyOutState = (CopyOutState) palloc0(sizeof(CopyOutStateData)); copyOutState->delim = (char *) delimiterCharacter; diff --git a/src/backend/distributed/executor/multi_executor.c b/src/backend/distributed/executor/multi_executor.c index cdbafacc0..f41553cb6 100644 --- a/src/backend/distributed/executor/multi_executor.c +++ b/src/backend/distributed/executor/multi_executor.c @@ -411,8 +411,8 @@ ReadFileIntoTupleStore(char *fileName, char *copyFormat, TupleDesc tupleDescript copyOptions = lappend(copyOptions, copyOption); CopyFromState copyState = BeginCopyFrom_compat(NULL, stubRelation, NULL, - fileName, false, NULL, - NULL, copyOptions); + fileName, false, NULL, + NULL, copyOptions); while (true) { diff --git a/src/backend/distributed/metadata/distobject.c b/src/backend/distributed/metadata/distobject.c index b96db6ed0..6eaf00f15 100644 --- a/src/backend/distributed/metadata/distobject.c +++ b/src/backend/distributed/metadata/distobject.c @@ -75,8 +75,12 @@ citus_unmark_object_distributed(PG_FUNCTION_ARGS) { ereport(ERROR, (errmsg("object still exists"), errdetail("the %s \"%s\" still exists", - getObjectTypeDescription_compat(&address, /* missingOk: */ false), - getObjectIdentity_compat(&address, /* missingOk: */ false)), + getObjectTypeDescription_compat(&address, + + /* missingOk: */ false), + getObjectIdentity_compat(&address, + + /* missingOk: */ false)), errhint("drop the object via a DROP command"))); } diff --git a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql index ae3b0b900..b285dc93a 100644 --- a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql +++ b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql @@ -31,7 +31,7 @@ BEGIN * Citus extension, so we create that dependency here. * We are not using: * ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg - * because we don't have an easy way to check if the aggregate + * because we don't have an easy way to check if the aggregate * exists with anyarray type or anycompatiblearray type. */ INSERT INTO pg_depend diff --git a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql index ae3b0b900..b285dc93a 100644 --- a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql +++ b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql @@ -31,7 +31,7 @@ BEGIN * Citus extension, so we create that dependency here. * We are not using: * ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg - * because we don't have an easy way to check if the aggregate + * because we don't have an easy way to check if the aggregate * exists with anyarray type or anycompatiblearray type. */ INSERT INTO pg_depend diff --git a/src/backend/distributed/utils/function_utils.c b/src/backend/distributed/utils/function_utils.c index f0818d0c8..d410246ea 100644 --- a/src/backend/distributed/utils/function_utils.c +++ b/src/backend/distributed/utils/function_utils.c @@ -50,7 +50,7 @@ FunctionOidExtended(const char *schemaName, const char *functionName, int argume argumentCount, argumentList, findVariadics, - findDefaults, + findDefaults, false, true); diff --git a/src/include/distributed/commands/utility_hook.h b/src/include/distributed/commands/utility_hook.h index 22f8a8cf1..7845fb051 100644 --- a/src/include/distributed/commands/utility_hook.h +++ b/src/include/distributed/commands/utility_hook.h @@ -63,7 +63,7 @@ typedef struct DDLJob } DDLJob; -extern void multi_ProcessUtility(PlannedStmt *pstmt, const char *queryString, +extern void multi_ProcessUtility(PlannedStmt * pstmt, const char *queryString, #if PG_VERSION_NUM >= PG_VERSION_14 bool readOnlyTree, #endif diff --git a/src/test/regress/Makefile b/src/test/regress/Makefile index 83027d53b..2ef23cd12 100644 --- a/src/test/regress/Makefile +++ b/src/test/regress/Makefile @@ -243,4 +243,4 @@ clean distclean maintainer-clean: rm -f $(output_files) $(input_files) rm -rf tmp_check/ -all: create-tablespaces \ No newline at end of file +all: create-tablespaces diff --git a/src/test/regress/expected/.gitignore b/src/test/regress/expected/.gitignore index 086ad0ec6..0197c3b7e 100644 --- a/src/test/regress/expected/.gitignore +++ b/src/test/regress/expected/.gitignore @@ -20,4 +20,5 @@ /multi_mx_copy_data.out /multi_outer_join.out /multi_outer_join_reference.out +/tablespace.out /worker_copy.out diff --git a/src/test/regress/expected/tablespace.out b/src/test/regress/expected/tablespace.out deleted file mode 100644 index 2aba6ffdd..000000000 --- a/src/test/regress/expected/tablespace.out +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts0'; -\c - - - :worker_1_port -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts1'; -\c - - - :worker_2_port -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts2'; diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source index 82b7cb724..10849ac65 100644 --- a/src/test/regress/input/tablespace.source +++ b/src/test/regress/input/tablespace.source @@ -2,4 +2,4 @@ CREATE TABLESPACE test_tablespace LOCATION '@abs_srcdir@/data/ts0'; \c - - - :worker_1_port CREATE TABLESPACE test_tablespace LOCATION '@abs_srcdir@/data/ts1'; \c - - - :worker_2_port -CREATE TABLESPACE test_tablespace LOCATION '@abs_srcdir@/data/ts2'; \ No newline at end of file +CREATE TABLESPACE test_tablespace LOCATION '@abs_srcdir@/data/ts2'; diff --git a/src/test/regress/sql/.gitignore b/src/test/regress/sql/.gitignore index e5b354bbf..5b06080ed 100644 --- a/src/test/regress/sql/.gitignore +++ b/src/test/regress/sql/.gitignore @@ -20,4 +20,5 @@ /multi_mx_copy_data.sql /multi_outer_join.sql /multi_outer_join_reference.sql +/tablespace.sql /worker_copy.sql diff --git a/src/test/regress/sql/tablespace.sql b/src/test/regress/sql/tablespace.sql deleted file mode 100644 index 427039892..000000000 --- a/src/test/regress/sql/tablespace.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts0'; -\c - - - :worker_1_port -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts1'; -\c - - - :worker_2_port -CREATE TABLESPACE test_tablespace LOCATION '/home/talha/citus/src/test/regress/data/ts2'; \ No newline at end of file