Thanks Kuntal for the report. Let me know if this patch works for you.
On Wed, 8 Apr 2020 at 13:00, Kuntal Ghosh <[email protected]>
wrote:
> Hi,
>
> On Wed, Apr 8, 2020 at 7:07 AM Etsuro Fujita <[email protected]>
> wrote:
> >
> > Pushed after modifying some comments further, based on the suggestions
> > of Ashutosh.
> I'm getting the following warning during compilation.
>
> partbounds.c: In function ‘partition_bounds_merge’:
> partbounds.c:1024:21: warning: unused variable ‘inner_binfo’
> [-Wunused-variable]
> PartitionBoundInfo inner_binfo = inner_rel->boundinfo;
> ^
> For fixing the same, we can declare inner_binfo as
> PG_USED_FOR_ASSERTS_ONLY as it is not used for any other purpose.
>
> --
> Thanks & Regards,
> Kuntal Ghosh
> EnterpriseDB: http://www.enterprisedb.com
>
--
Best Wishes,
Ashutosh
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 7607501fe7..4681441dcc 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -1021,7 +1021,6 @@ partition_bounds_merge(int partnatts,
List **outer_parts, List **inner_parts)
{
PartitionBoundInfo outer_binfo = outer_rel->boundinfo;
- PartitionBoundInfo inner_binfo = inner_rel->boundinfo;
/*
* Currently, this function is called only from try_partitionwise_join(),
@@ -1032,7 +1031,7 @@ partition_bounds_merge(int partnatts,
jointype == JOIN_ANTI);
/* The partitioning strategies should be the same. */
- Assert(outer_binfo->strategy == inner_binfo->strategy);
+ Assert(outer_binfo->strategy == inner_rel->boundinfo->strategy);
*outer_parts = *inner_parts = NIL;
switch (outer_binfo->strategy)