Re: ltree bug handling nulls (was Stored procedure failure) - Mailing list pgsql-general

From Richard Huxton
Subject Re: ltree bug handling nulls (was Stored procedure failure)
Date
Msg-id 412DBF7A.50006@archonet.com
Whole thread Raw
In response to Re: Stored procedure failure  (Michal Hlavac <hlavki@medium13.sk>)
List pgsql-general
Michal Hlavac wrote:
> Richard Huxton wrote:
>
>>
>> Looking at the 8.0beta source, the functions (...ltree_isparent) are
>> all marked strict so they should just return null on a null parameter.
>>
>> What happens if you set my_path to some non-null but un-matched value
>> before the problem line?
>>
>
> When my_path have non-null value, everything is OK...
>
> I don't understand why one null value would crash the server???

Because it attempts to follow a pointer that isn't there.

If you installed from source, can you check contrib/ltree/ltree.sql.in
and check the "isstrict" attribute is set:
   CREATE FUNCTION ltree_isparent(ltree,ltree)
   RETURNS bool
   AS 'MODULE_PATHNAME'
   LANGUAGE 'C' WITH (isstrict,iscachable);

If it is, then you'll have to wait for a developer to take an interest,
I'm stumped. Shouldn't take long, but if you wanted to be thorough you
could report a bug via the bugs mailing list or the website.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Daniel Schuchardt
Date:
Subject: Trigger question
Next
From: "Robert Deme"
Date:
Subject: unsubscribe