BUG #5112: Segmentation fault on ts_stat with empty words

Yury Don <yura@vpcit.ru>

From: "Yury Don" <yura@vpcit.ru>
To: pgsql-bugs@postgresql.org
Date: 2009-10-13T14:22:24Z
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5112
Logged by:          Yury Don
Email address:      yura@vpcit.ru
PostgreSQL version: 8.4.1
Operating system:   Debian Linux (architecture amd64)
Description:        Segmentation fault on ts_stat with empty words
Details: 

When call ts_stat function with empty argument, backend crashes, for
example:
select word from ts_stat('select \'\'::tsvector;');
select word from ts_stat('select null::tsvector;');

This causes crash on calling ts_stat with word from stop words:
select word from ts_stat('select to_tsvector(\'me\');');

In log file there are message "server process (PID ...) was terminated by
signal 11: Segmentation fault"