Re: Re: GIST question

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Re: GIST question
Date: 2001-05-15 22:37:37
Message-ID: 200105152237.f4FMbbG11463@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I will keep the patch for a day and apply it if no one objects.
>
> I object. You still have no idea what that test is for or whether
> there may be any value in keeping it. It seems clear that the original
> GIST authors thought the flag was useful.
>
> I should also point out that the fact that the flag is always "true"
> today is because I ripped out some code in index.c a version or three
> back. 6.5 had
>
> indexForm->indhaskeytype = 0;
> while (attributeList != NIL)
> {
> IndexKey = (IndexElem *) lfirst(attributeList);
> if (IndexKey->typename != NULL)
> {
> indexForm->indhaskeytype = 1;
> break;
> }
> attributeList = lnext(attributeList);
> }
>
> which I removed because it was a security hole (you could tell the
> system to treat any data type as any other datatype, with obvious
> possibilities for coredump). But I didn't look hard at what the
> GIST code was using the flag for...

I did look at the code inside the tests. The first was to decide if it
was suppose to look in pg_attribute for the byvalue flag. The last two
controlled the if gistentryinit() was called. No idea what that is
because the variable names are single letters. Gistentryinit() is:

#define gistentryinit(e, pr, r, pg, o, b, l)\
do {(e).pred = pr; (e).rel = r; (e).page = pg; (e).offset = o; (e).bytes = b;
(e).leafkey = l;} while (0)

I have to say I have no idea how pg_index.indhaskeytype is related to
gistentryinit().

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-05-15 23:35:09 Re: Re: GIST question
Previous Message Tom Lane 2001-05-15 22:08:50 Re: Re: GIST question