BUG #6185: Segmentation fault with NULL string columns

Поиск
Список
Период
Сортировка
От Isaac Jurado
Тема BUG #6185: Segmentation fault with NULL string columns
Дата
Msg-id 201108300851.p7U8ptkf014277@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #6185: Segmentation fault with NULL string columns  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: BUG #6185: Segmentation fault with NULL string columns  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      6185
Logged by:          Isaac Jurado
Email address:      ijurado@econcept.es
PostgreSQL version: 8.4.8
Operating system:   Ubuntu 10.04.03 LTS (x86_64)
Description:        Segmentation fault with NULL string columns
Details:

Here's the script to make it fail:

CREATE DATABASE killme;
\c killme
CREATE FUNCTION to_ascii(bytea, name) RETURNS text AS 'to_ascii_encname'
LANGUAGE internal;
CREATE TABLE mytable (id INTEGER PRIMARY KEY, mytext TEXT);
INSERT INTO mytable (id, mytext) VALUES (1, '');
SELECT * FROM mytable WHERE to_ascii(convert_to(mytext, 'latin1'), 'latin1')
= to_ascii(convert_to('nicetry', 'latin1'), 'latin1');
UPDATE mytable SET mytext=NULL WHERE id=1;
SELECT * FROM mytable WHERE to_ascii(convert_to(mytext, 'latin1'), 'latin1')
= to_ascii(convert_to('nicetry', 'latin1'), 'latin1');

After the second query, the database server segfaults.  Note that it only
fails for NULL values.  The to_ascii/convert_to combination is a recipe for
diacritics elimination found on a PostgreSQL forum.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Ding Yuan"
Дата:
Сообщение: BUG #6184: Inconsistencies in log messages
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #6185: Segmentation fault with NULL string columns