From: | Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> |
---|---|
To: | Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> |
Cc: | Ildar Musin <i(dot)musin(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Declarative partitioning |
Date: | 2016-07-19 13:53:44 |
Message-ID: | CAFjFpRcEJi2md39HfTU8snYaL8-5gNeUA9UVH73RJx=Bxt2naA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I am seeing following warning with this set of patches.
gram.y:4734:24: warning: assignment from incompatible pointer type [enabled
by default]
On Tue, Jul 5, 2016 at 10:18 AM, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
> wrote:
> On 2016/07/04 21:31, Ashutosh Bapat wrote:
> > Hi Amit,
> > I observed that the ChangeVarNodes call at line 1229 in
> > get_relation_constraints() (code below) changes the varno in the cached
> > copy of partition key expression, which is undesirable. The reason for
> this
> > seems to be that the RelationGetPartitionCheckQual() returns the copy of
> > partition key expression directly from the cache. This is mostly because
> > get_check_qual_for_range() directly works on cached copy of partition key
> > expressions, which it should never.
>
> Yes, a copyObject() on key->partexprs items seems necessary. Will fix that.
>
> > 1223 /* Append partition check quals, if any */
> > 1224 pcqual = RelationGetPartitionCheckQual(relation);
> > 1225 if (pcqual)
> > 1226 {
> > 1227 /* Fix Vars to have the desired varno */
> > 1228 if (varno != 1)
> > 1229 ChangeVarNodes((Node *) pcqual, 1, varno, 0);
> > 1230
> > 1231 result = list_concat(result, pcqual);
> > 1232 }
> >
> > Because of this, the first time through the partition key expressions are
> > valid, but then onwards they are restamped with the varno of the first
> > partition.
> >
> > Please add testcases to your patch to catch such types of issues.
>
> I will integrate tests into the patch(es) and add some more.
>
> Thanks,
> Amit
>
>
>
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2016-07-19 14:00:05 | Re: sslmode=require fallback |
Previous Message | petrum@gmail.com | 2016-07-19 13:08:48 | Question about an inconsistency - 3 |