Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
funbringer committed Feb 13, 2017
1 parent f89f606 commit 369b49d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/partition_creation.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ create_partitions_for_value(Oid relid, Datum value, Oid value_type)
last_partition = create_partitions_for_value_internal(relid,
value,
value_type,
false);
false); /* backend */
}
}
else
Expand Down Expand Up @@ -300,7 +300,8 @@ create_partitions_for_value(Oid relid, Datum value, Oid value_type)
* use create_partitions_for_value() instead.
*/
Oid
create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type, bool IsBgWorker)
create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type,
bool is_background_worker)
{
MemoryContext old_mcxt = CurrentMemoryContext;
Oid partid = InvalidOid; /* last created partition (or InvalidOid) */
Expand Down Expand Up @@ -406,7 +407,7 @@ create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type, boo
ErrorData *edata;

/* Simply rethrow ERROR if we're in backend */
if (!IsBgWorker)
if (!is_background_worker)
PG_RE_THROW();

/* Switch to the original context & copy edata */
Expand Down
3 changes: 2 additions & 1 deletion src/partition_creation.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

/* Create RANGE partitions to store some value */
Oid create_partitions_for_value(Oid relid, Datum value, Oid value_type);
Oid create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type, bool IsBgWorker);
Oid create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type,
bool is_background_worker);


/* Create one RANGE partition */
Expand Down
2 changes: 1 addition & 1 deletion src/pathman_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ bgw_main_spawn_partitions(Datum main_arg)
args->result = create_partitions_for_value_internal(args->partitioned_table,
value, /* unpacked Datum */
args->value_type,
true); /* run under background woker */
true); /* background woker */

/* Finish transaction in an appropriate way */
if (args->result == InvalidOid)
Expand Down

0 comments on commit 369b49d

Please sign in to comment.