Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e58905b

Browse files
committed
also rename columns in pathman.h
1 parent 070bd3f commit e58905b

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/include/pathman.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
#define PATHMAN_CONFIG "pathman_config"
4747
#define Natts_pathman_config 5
4848
#define Anum_pathman_config_partrel 1 /* partitioned relation (regclass) */
49-
#define Anum_pathman_config_expression 2 /* partition expression (original) */
49+
#define Anum_pathman_config_expr 2 /* partition expression (original) */
5050
#define Anum_pathman_config_parttype 3 /* partitioning type (1|2) */
5151
#define Anum_pathman_config_range_interval 4 /* interval for RANGE pt. (text) */
52-
#define Anum_pathman_config_expression_p 5 /* parsed partitioning expression (text) */
52+
#define Anum_pathman_config_cooked_expr 5 /* parsed partitioning expression (text) */
5353

5454
/* type modifier (typmod) for 'range_interval' */
5555
#define PATHMAN_CONFIG_interval_typmod -1

src/init.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
636636

637637
/* Perform checks for non-NULL columns */
638638
Assert(!isnull[Anum_pathman_config_partrel - 1]);
639-
Assert(!isnull[Anum_pathman_config_expression - 1]);
639+
Assert(!isnull[Anum_pathman_config_expr - 1]);
640640
Assert(!isnull[Anum_pathman_config_parttype - 1]);
641641
}
642642

@@ -686,8 +686,8 @@ pathman_config_invalidate_parsed_expression(Oid relid)
686686
HeapTuple new_htup;
687687

688688
/* Reset parsed expression */
689-
values[Anum_pathman_config_expression_p - 1] = (Datum) 0;
690-
nulls[Anum_pathman_config_expression_p - 1] = true;
689+
values[Anum_pathman_config_cooked_expr - 1] = (Datum) 0;
690+
nulls[Anum_pathman_config_cooked_expr - 1] = true;
691691

692692
rel = heap_open(get_pathman_config_relid(false), RowExclusiveLock);
693693

@@ -714,13 +714,13 @@ pathman_config_refresh_parsed_expression(Oid relid,
714714
HeapTuple htup_new;
715715

716716
/* get and parse expression */
717-
expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expression - 1]);
717+
expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expr - 1]);
718718
expr_datum = cook_partitioning_expression(relid, expr_cstr, NULL);
719719
pfree(expr_cstr);
720720

721721
/* prepare tuple values */
722-
values[Anum_pathman_config_expression_p - 1] = expr_datum;
723-
isnull[Anum_pathman_config_expression_p - 1] = false;
722+
values[Anum_pathman_config_cooked_expr - 1] = expr_datum;
723+
isnull[Anum_pathman_config_cooked_expr - 1] = false;
724724

725725
rel = heap_open(get_pathman_config_relid(false), RowExclusiveLock);
726726

@@ -816,7 +816,7 @@ read_pathman_config(void)
816816
/* These attributes are marked as NOT NULL, check anyway */
817817
Assert(!isnull[Anum_pathman_config_partrel - 1]);
818818
Assert(!isnull[Anum_pathman_config_parttype - 1]);
819-
Assert(!isnull[Anum_pathman_config_expression - 1]);
819+
Assert(!isnull[Anum_pathman_config_expr - 1]);
820820

821821
/* Extract values from Datums */
822822
relid = DatumGetObjectId(values[Anum_pathman_config_partrel - 1]);

src/partition_creation.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ build_partitioning_expression(Oid parent_relid,
17161716
elog(ERROR, "table \"%s\" is not partitioned",
17171717
get_rel_name_or_relid(parent_relid));
17181718

1719-
expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expression - 1]);
1719+
expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expr - 1]);
17201720
expr = parse_partitioning_expression(parent_relid, expr_cstr, NULL, NULL);
17211721
pfree(expr_cstr);
17221722

@@ -1726,9 +1726,9 @@ build_partitioning_expression(Oid parent_relid,
17261726
char *expr_p_cstr;
17271727

17281728
/* We can safely assume that this field will always remain not null */
1729-
Assert(!isnull[Anum_pathman_config_expression_p - 1]);
1729+
Assert(!isnull[Anum_pathman_config_cooked_expr - 1]);
17301730
expr_p_cstr =
1731-
TextDatumGetCString(values[Anum_pathman_config_expression_p - 1]);
1731+
TextDatumGetCString(values[Anum_pathman_config_cooked_expr - 1]);
17321732

17331733
/* Finally return expression type */
17341734
*expr_type = exprType(stringToNode(expr_p_cstr));

src/pl_funcs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,11 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
798798
values[Anum_pathman_config_parttype - 1] = Int32GetDatum(parttype);
799799
isnull[Anum_pathman_config_parttype - 1] = false;
800800

801-
values[Anum_pathman_config_expression - 1] = CStringGetTextDatum(expression);
802-
isnull[Anum_pathman_config_expression - 1] = false;
801+
values[Anum_pathman_config_expr - 1] = CStringGetTextDatum(expression);
802+
isnull[Anum_pathman_config_expr - 1] = false;
803803

804-
values[Anum_pathman_config_expression_p - 1] = expr_datum;
805-
isnull[Anum_pathman_config_expression_p - 1] = false;
804+
values[Anum_pathman_config_cooked_expr - 1] = expr_datum;
805+
isnull[Anum_pathman_config_cooked_expr - 1] = false;
806806

807807
/* Insert new row into PATHMAN_CONFIG */
808808
pathman_config = heap_open(get_pathman_config_relid(false), RowExclusiveLock);

src/relation_info.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ refresh_pathman_relation_info(Oid relid,
167167
prel->parttype = DatumGetPartType(values[Anum_pathman_config_parttype - 1]);
168168

169169
/* Fetch cooked partitioning expression */
170-
expr = TextDatumGetCString(values[Anum_pathman_config_expression_p - 1]);
170+
expr = TextDatumGetCString(values[Anum_pathman_config_cooked_expr - 1]);
171171

172172
/* Expression and attname should be saved in cache context */
173173
old_mcxt = MemoryContextSwitchTo(PathmanRelationCacheContext);
174174

175175
/* Build partitioning expression tree */
176-
prel->expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expression - 1]);
176+
prel->expr_cstr = TextDatumGetCString(values[Anum_pathman_config_expr - 1]);
177177
prel->expr = (Node *) stringToNode(expr);
178178
fix_opfuncids(prel->expr);
179179

@@ -360,7 +360,7 @@ get_pathman_relation_info(Oid relid)
360360
/* Check that PATHMAN_CONFIG table contains this relation */
361361
if (pathman_config_contains_relation(relid, values, isnull, NULL, &iptr))
362362
{
363-
bool upd_expr = isnull[Anum_pathman_config_expression_p - 1];
363+
bool upd_expr = isnull[Anum_pathman_config_cooked_expr - 1];
364364
if (upd_expr)
365365
pathman_config_refresh_parsed_expression(relid, values, isnull, &iptr);
366366

@@ -1012,7 +1012,7 @@ try_perform_parent_refresh(Oid parent)
10121012

10131013
if (pathman_config_contains_relation(parent, values, isnull, NULL, &iptr))
10141014
{
1015-
bool should_update_expr = isnull[Anum_pathman_config_expression_p - 1];
1015+
bool should_update_expr = isnull[Anum_pathman_config_cooked_expr - 1];
10161016

10171017
if (should_update_expr)
10181018
pathman_config_refresh_parsed_expression(parent, values, isnull, &iptr);

0 commit comments

Comments
 (0)