From: | Jaimin Pan <jaimin(dot)pan(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, andres(at)2ndquadrant(dot)com |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: [Report Bug With Patch] Rel Cache Bug |
Date: | 2015-03-26 07:30:51 |
Message-ID: | CABP8UDSgi24n1hjPNt6oHMC_dxEA+grakP9mJ+01Y=TF_GYyPw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Thanks you for your replay.
I realized that i am wrong. I just miss the whole struct swap at the
beginning.
I am so sorry for bothering you with my fault.
2015-03-26 1:38 GMT+08:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Jaimin Pan <jaimin(dot)pan(at)gmail(dot)com> writes:
> > I think there is a bug in rel cache rebuild of release 9.4.1.
> > it also exists on some other release.
>
> > the issue was introduced by 491dd4a97daa6b4de9ee8401ada10ad5da76af46
>
> > -- a/src/backend/utils/cache/relcache.c
> > +++ b/src/backend/utils/cache/relcache.c
> > @@ -2166,9 +2166,9 @@ RelationClearRelation(Relation relation, bool
> rebuild)
> > /* ... but actually, we don't have to update
> newrel->rd_rel
> > */
> > memcpy(relation->rd_rel, newrel->rd_rel,
> CLASS_TUPLE_SIZE);
> > /* preserve old tupledesc and rules if no logical change
> */
> > - if (keep_tupdesc)
> > + if (!keep_tupdesc)
> > SWAPFIELD(TupleDesc, rd_att);
> > - if (keep_rules)
> > + if (!keep_rules)
> > {
> > SWAPFIELD(RuleLock *, rd_rules);
> > SWAPFIELD(MemoryContext, rd_rulescxt);
>
>
> You would need to provide a fairly convincing argument why you think that
> five-year-old code is backwards. Asserting there's a problem with
> absolutely zero evidence is not likely to impress anyone.
>
> (For the record, it did and does still look right to me. As per the
> comment about thirty lines up, what we're doing is un-swapping the
> fields we don't want to change. If keep_tupdesc is true, we don't
> want to change rd_att, so we need to swap its old value back.
> Likewise for the other thing.)
>
> regards, tom lane
>
From | Date | Subject | |
---|---|---|---|
Next Message | jurgen.soenen | 2015-03-26 08:46:57 | BUG #12904: Installation postgres fails when Windows user name contains spaces |
Previous Message | Anandhi Arumugam | 2015-03-26 04:58:46 | Re: BUG #12896: Unable to export data from Postgresql database |