Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Install

Before build and install `shared_ispell` you should ensure following:

* PostgreSQL version is 9.6 or later.
* PostgreSQL version is from 9.6 to 17 [^1]

Installing the extension is quite simple. In that case all you need to do is this:

Expand Down Expand Up @@ -154,4 +154,9 @@ but there is not related code in the GitHub.

Author
------
Tomas Vondra [GitHub](https://github.com/tvondra)
Tomas Vondra [GitHub](https://github.com/tvondra)

Notes
------

[^1]: If you would like support for newer versions, please contact us: [info@postgrespro.ru](mailto:info@postgrespro.ru?subject=shared_ispell)
50 changes: 0 additions & 50 deletions expected/security_1.out

This file was deleted.

10 changes: 4 additions & 6 deletions src/shared_ispell.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
#include "storage/ipc.h"
#include "storage/shmem.h"

#include "catalog/pg_collation_d.h"
#include "commands/defrem.h"
#include "tsearch/ts_locale.h"
#include "utils/formatting.h"
#include "access/htup_details.h"
#include "funcapi.h"
#include "utils/builtins.h"
Expand Down Expand Up @@ -348,7 +346,7 @@ init_shared_dict(DictInfo *info, MemoryContext infoCntx,
dict->useFlagAliases = true;
dict->lenAffixData = info->dict.lenAffixData;
dict->nAffixData = info->dict.nAffixData;
dict->AffixData = (const char **) palloc0(dict->nAffixData * sizeof(char *));
dict->AffixData = (char **) palloc0(dict->nAffixData * sizeof(char *));

for (i = 0; i < dict->nAffixData; i++)
dict->AffixData[i] = pstrdup(info->dict.AffixData[i]);
Expand Down Expand Up @@ -394,7 +392,7 @@ init_shared_dict(DictInfo *info, MemoryContext infoCntx,
{
StopList stoplist;

readstoplist(stopFile, &stoplist, str_tolower);
readstoplist(stopFile, &stoplist, lowerstr);

size = sizeStopList(&stoplist, stopFile);
if (size > segment_info->available)
Expand Down Expand Up @@ -612,7 +610,7 @@ dispell_lexize(PG_FUNCTION_ARGS)
if (len <= 0)
PG_RETURN_POINTER(NULL);

txt = str_tolower(in, len, DEFAULT_COLLATION_OID);
txt = lowerstr_with_len(in, len);

/* need to lock the segment in shared mode */
LWLockAcquire(segment_info->lock, LW_SHARED);
Expand Down Expand Up @@ -820,7 +818,7 @@ copyIspellDict(IspellDict *dict, char *dictFile, char *affixFile, int size, int

/* copy affix data */
copy->dict.nAffixData = dict->nAffixData;
copy->dict.AffixData = (const char **) shalloc(sizeof(char *) * dict->nAffixData);
copy->dict.AffixData = (char **) shalloc(sizeof(char *) * dict->nAffixData);
for (i = 0; i < copy->dict.nAffixData; i++)
copy->dict.AffixData[i] = shstrcpy(dict->AffixData[i]);

Expand Down