Re: Crash with empty dictionary

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Hamid Quddus Akhtar" <hamid(dot)akhtar(at)enterprisedb(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Crash with empty dictionary
Date: 2007-08-22 15:12:40
Message-ID: 46CC5268.7020400@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
>> "Hamid Quddus Akhtar" <hamid(dot)akhtar(at)enterprisedb(dot)com> writes:
>>>> Offhand I'd say that an empty file is a legitimate corner case,
>>>> so we should just take it silently.
>>> Shouldn't we be warning about an empty file rather than just swallowing
>>> up the error?
>> You are jumping to a conclusion, namely that it is an error. If it's
>> a legitimate corner case, throwing a warning every time the file is
>> read would be incredibly annoying.
>>
>> If it's not a legitimate case, then we should throw a real error.
>> A warning just strikes me as the worst of both worlds.
>
> A zero-length file seems fine to me in this case.

It also seems to have problems with an affix-file with a single entry.

Looking closer at the tmpCtx hack, it looks like it can't just be
replaced by setting CurrentMemoryContext to a temporary context. Some
stuff needs to be allocated in the ts cache entry's dictCtx, while other
stuff is temporary. I'll try to at least comment it.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message A.M. 2007-08-22 15:23:35 Re: Naming of the prefab snowball stemmer dictionaries
Previous Message Tom Lane 2007-08-22 15:10:44 Naming of the prefab snowball stemmer dictionaries