1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00

Remove rudiments of supporting procnum == 0 from 911e702077

Early versions of opclass options patch uses zero support procedure as opclass
options procedure.  This commit removes rudiments of it, which were committed
in 911e702077.  Also, it implements correct handling of amoptsprocnum == 0.
This commit is contained in:
Alexander Korotkov
2020-03-30 23:40:22 +03:00
parent 4b42a89938
commit 851b14b0c6
2 changed files with 20 additions and 12 deletions

View File

@@ -773,9 +773,9 @@ index_getprocid(Relation irel,
nproc = irel->rd_indam->amsupport;
Assert(procnum >= 0 && procnum <= (uint16) nproc);
Assert(procnum > 0 && procnum <= (uint16) nproc);
procindex = ((nproc + 1) * (attnum - 1)) + procnum;
procindex = (nproc * (attnum - 1)) + (procnum - 1);
loc = irel->rd_support;
@@ -809,9 +809,9 @@ index_getprocinfo(Relation irel,
nproc = irel->rd_indam->amsupport;
optsproc = irel->rd_indam->amoptsprocnum;
Assert(procnum >= 0 && procnum <= (uint16) nproc);
Assert(procnum > 0 && procnum <= (uint16) nproc);
procindex = ((nproc + 1) * (attnum - 1)) + procnum;
procindex = (nproc * (attnum - 1)) + (procnum - 1);
locinfo = irel->rd_supportinfo;
@@ -937,10 +937,14 @@ index_opclass_options(Relation indrel, AttrNumber attnum, Datum attoptions,
bool validate)
{
int amoptsprocnum = indrel->rd_indam->amoptsprocnum;
Oid procid = index_getprocid(indrel, attnum, amoptsprocnum);
Oid procid = InvalidOid;
FmgrInfo *procinfo;
local_relopts relopts;
/* fetch options support procedure if specified */
if (amoptsprocnum != 0)
procid =index_getprocid(indrel, attnum, amoptsprocnum);
if (!OidIsValid(procid))
{
Oid opclass;