Re: Segmentation fault using digest from pg_crypto - Mailing list pgsql-hackers

From Marko Kreen
Subject Re: Segmentation fault using digest from pg_crypto
Date
Msg-id e51f66da0708240013t40451787ub12b65bdcf6b86c1@mail.gmail.com
Whole thread Raw
In response to Re: Segmentation fault using digest from pg_crypto  (Manuel Sugawara <masm@fciencias.unam.mx>)
Responses Re: Segmentation fault using digest from pg_crypto  (Manuel Sugawara <masm@fciencias.unam.mx>)
List pgsql-hackers
On 8/24/07, Manuel Sugawara <masm@fciencias.unam.mx> wrote:
> Manuel Sugawara <masm@fciencias.unam.mx> writes:
> > I have a simple query that uses digest(data, 'sha1') and consistently
> > crashes the backend
>
> The problem is with null arguments:
>
> ciencias=# select digest(null, 'sha1');

In 8.0 the pgcrypto functions were non-strict and checked for NULLs.

In 8.1 they were made STRICT.

In 8.2 the NULL check were removed from code.

That means if you use function signatures from 8.0 with
pgcrypto from 8.2, they will crash on NULL.

To fix it, just reinitialize functions: \i pgcrypto.sql

-- 
marko


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Final background writer cleanup for 8.3
Next
From: Richard Huxton
Date:
Subject: Re: Segmentation fault using digest from pg_crypto