aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tsearch/spell.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:02:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:03:09 -0400
commit1e16a8107db9a50435b39e09c6f9c52c45e63e1a (patch)
treebf2231fc078b46004c7814ba871e3c38c1d8d52d /src/backend/tsearch/spell.c
parent210f95f1cd59c6fdfe0f84b922c19d8498ac377d (diff)
downloadpostgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.tar.gz
postgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.zip
Teach regular expression operators to honor collations.
This involves getting the character classification and case-folding functions in the regex library to use the collations infrastructure. Most of this work had been done already in connection with the upper/lower and LIKE logic, so it was a simple matter of transposition. While at it, split out these functions into a separate source file regc_pg_locale.c, so that they can be correctly labeled with the Postgres project's license rather than the Scriptics license. These functions are 100% Postgres-written code whereas what remains in regc_locale.c is still mostly not ours, so lumping them both under the same copyright notice was getting more and more misleading.
Diffstat (limited to 'src/backend/tsearch/spell.c')
-rw-r--r--src/backend/tsearch/spell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index ecc880f54de..8c0eaa78a7c 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -14,6 +14,7 @@
#include "postgres.h"
+#include "catalog/pg_collation.h"
#include "tsearch/dicts/spell.h"
#include "tsearch/ts_locale.h"
#include "utils/memutils.h"
@@ -425,7 +426,9 @@ NIAddAffix(IspellDict *Conf, int flag, char flagflags, const char *mask, const c
wmask = (pg_wchar *) tmpalloc((masklen + 1) * sizeof(pg_wchar));
wmasklen = pg_mb2wchar_with_len(tmask, wmask, masklen);
- err = pg_regcomp(&(Affix->reg.regex), wmask, wmasklen, REG_ADVANCED | REG_NOSUB);
+ err = pg_regcomp(&(Affix->reg.regex), wmask, wmasklen,
+ REG_ADVANCED | REG_NOSUB,
+ DEFAULT_COLLATION_OID);
if (err)
{
char errstr[100];