From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18135: Incorrect memory access occurs when attaching a partition with an index
Date: Sat, 30 Sep 2023 20:39:37 -0400
Message-ID: <1614549.1696120777@sss.pgh.pa.us> (raw)
In-Reply-To: <ZRi96-kUPFy0ILzb@paquier.xyz>
References: <18135-532f4a755e71e4d2@postgresql.org>
<1043711.1695922299@sss.pgh.pa.us>
<ZRi96-kUPFy0ILzb@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> I can see that this has already been committed as 9f71e10d65, but are
> you sure that this is correct? I didn't take the time to reply back,
> because I got the feeling that even what I proposed is not correct.
> The previous code was careful enough to look at the information from
> info2 only *through* the attribute map, which is not what this new
> code is doing. Rather than looking directly at the elements in info2
> at each iteration, shouldn't this stuff loop over the elements in
> attmap->attnums for each info1->ii_IndexAttrNumbers[i]?
I think it's OK as is. What we are comparing in the modified logic
is whether index columns at the same column positions are expressions or
not, and that's not a matter for mapping. Once we've verified that
the current column is a non-expression in both indexes, then it's
appropriate to use the attmap to see whether the columns correspond.
(Or to put it another way: running "column zero" through the
attmap is always the wrong thing.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18135: Incorrect memory access occurs when attaching a partition with an index
In-Reply-To: <1614549.1696120777@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox