0003-Renaming-parameters-of-map_partition_var_attnos.patch
application/octet-stream
Filename: 0003-Renaming-parameters-of-map_partition_var_attnos.patch
Type: application/octet-stream
Part: 3
Patch
Format: format-patch
Series: patch 0003
Subject: Renaming parameters of map_partition_var_attnos()
| File | + | − |
|---|---|---|
| src/backend/catalog/partition.c | 9 | 8 |
| src/include/catalog/partition.h | 2 | 2 |
From 1226fbfa5c1355d99867c4a4fbf456176a1fd090 Mon Sep 17 00:00:00 2001
From: Amit Khandekar <amit.khandekar@enterprisedb.com>
Date: Tue, 19 Dec 2017 13:05:30 +0530
Subject: [PATCH] Renaming parameters of map_partition_var_attnos()
---
src/backend/catalog/partition.c | 17 +++++++++--------
src/include/catalog/partition.h | 4 ++--
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c
index 8a3b0ed..1189dd9 100644
--- a/src/backend/catalog/partition.c
+++ b/src/backend/catalog/partition.c
@@ -1446,7 +1446,8 @@ get_qual_from_partbound(Relation rel, Relation parent,
/*
* map_partition_varattnos - maps varattno of any Vars in expr from the
- * parent attno to partition attno.
+ * attno's of 'from_rel' partition to the attno's of 'to_rel' partition.
+ * The rels can be both leaf partition or a partitioned table.
*
* We must allow for cases where physical attnos of a partition can be
* different from the parent's.
@@ -1459,8 +1460,8 @@ get_qual_from_partbound(Relation rel, Relation parent,
* are working on Lists, so it's less messy to do the casts internally.
*/
List *
-map_partition_varattnos(List *expr, int target_varno,
- Relation partrel, Relation parent,
+map_partition_varattnos(List *expr, int fromrel_varno,
+ Relation to_rel, Relation from_rel,
bool *found_whole_row)
{
bool my_found_whole_row = false;
@@ -1469,14 +1470,14 @@ map_partition_varattnos(List *expr, int target_varno,
{
AttrNumber *part_attnos;
- part_attnos = convert_tuples_by_name_map(RelationGetDescr(partrel),
- RelationGetDescr(parent),
+ part_attnos = convert_tuples_by_name_map(RelationGetDescr(to_rel),
+ RelationGetDescr(from_rel),
gettext_noop("could not convert row type"));
expr = (List *) map_variable_attnos((Node *) expr,
- target_varno, 0,
+ fromrel_varno, 0,
part_attnos,
- RelationGetDescr(parent)->natts,
- RelationGetForm(partrel)->reltype,
+ RelationGetDescr(from_rel)->natts,
+ RelationGetForm(to_rel)->reltype,
&my_found_whole_row);
}
diff --git a/src/include/catalog/partition.h b/src/include/catalog/partition.h
index f3b7849..d50bc66 100644
--- a/src/include/catalog/partition.h
+++ b/src/include/catalog/partition.h
@@ -54,8 +54,8 @@ extern void check_new_partition_bound(char *relname, Relation parent,
extern Oid get_partition_parent(Oid relid);
extern List *get_qual_from_partbound(Relation rel, Relation parent,
PartitionBoundSpec *spec);
-extern List *map_partition_varattnos(List *expr, int target_varno,
- Relation partrel, Relation parent,
+extern List *map_partition_varattnos(List *expr, int fromrel_varno,
+ Relation to_rel, Relation from_rel,
bool *found_whole_row);
extern List *RelationGetPartitionQual(Relation rel);
extern Expr *get_partition_qual_relid(Oid relid);
--
2.1.4