Re: indxpath.c's references to IndexOptInfo.ncolumns are all wrong, no? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: indxpath.c's references to IndexOptInfo.ncolumns are all wrong, no?
Date
Msg-id CAH2-WzmcfxB-7VNLzrCmvMD-gb-4e5WEDM6jurn04m8ymHFviQ@mail.gmail.com
Whole thread Raw
In response to indxpath.c's references to IndexOptInfo.ncolumns are all wrong, no?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: indxpath.c's references to IndexOptInfo.ncolumns are all wrong, no?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Feb 10, 2019 at 5:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Apparently, whoever went through indxpath.c to substitute nkeycolumns
> for ncolumns was not paying attention.  As far as I can tell, the
> *only* place in there where it's correct to reference ncolumns is in
> check_index_only, where we determine which columns can be extracted from
> an index-only scan.

Ugh. Yeah, it's rather inconsistent.

> I've got mixed feelings about whether to try to fix this before
> tomorrow's wraps.  The attached patch seems correct and passes
> check-world, but there's sure not a lot of margin for error now.
> Thoughts?

I think that it should be fixed in the next point release if at all
possible. The bug is a simple omission. I have a hard time imagining
how your patch could possibly destabilize things, since nkeycolumns is
already used in numerous other places in indxpath.c.

-- 
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: dsa_allocate() faliure
Next
From: Alvaro Herrera
Date:
Subject: Re: Fixing findDependentObjects()'s dependency on scan order(regressions in DROP diagnostic messages)