Skip site navigation (1) Skip section navigation (2)

Re: SEGV in contrib/array/array_iterator.c

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Matt Peterson <matt(at)caldera(dot)com>, <dz(at)cs(dot)unitn(dot)it>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: SEGV in contrib/array/array_iterator.c
Date: 2002-04-02 20:05:48
Message-ID: 20020402115926.F79618-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Tue, 2 Apr 2002, Tom Lane wrote:

> Matt Peterson <matt(at)caldera(dot)com> writes:
>
> > +     if(value == 0)
> > +     {
> > +         /* elog(NOTICE, "array_iterator: value is null"); */
> > +               return (0);
> > +     }
>
> This patch is certainly wrong, as it will break array_iterator for
> non-pointer datatypes (no, I do not believe your assertion to the
> contrary).
>
> More to the point, inserting explicit tests for null is an obsolete
> approach; the preferred way to do things these days is to mark the SQL
> declarations of such functions with "isStrict".  Would you instead
> update contrib/array to rely on isStrict?

Are the array iterator functions supposed to act sort of like
=ANY/=ALL except across an array instead of a subselect?  If so,
isStrict probably isn't right, since for an empty subselect the return
value does not depend on the element being searched for.  If not,
that would probably be the easiest fix.


In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-04-02 20:22:05
Subject: Re: SEGV in contrib/array/array_iterator.c
Previous:From: Tom LaneDate: 2002-04-02 18:29:27
Subject: Re: SEGV in contrib/array/array_iterator.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group