pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ufuk@paralaus.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8821: pg_trgm segfault with Turkish locale database
Date: Mon, 13 Jan 2014 11:09:45 -0500
Message-ID: <10064.1389629385@sss.pgh.pa.us> (raw)
In-Reply-To: <20140113125641.30125.40578@wrigleys.postgresql.org>
References: <20140113125641.30125.40578@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

ufuk@paralaus.com writes:
> Given a database with encoding UTF-8, locale tr_TR.UTF-8, 'pg_trgm'
> extension enabled, and the following setup:

> CREATE TABLE car_makers (maker TEXT);
> INSERT INTO car_makers VALUES ('AUDI'), ('MINI');

> Run any one of the following commands:

> - SELECT maker <-> 'MAZDA' FROM car_makers;
> - SELECT similarity(maker, 'MAZDA') FROM car_makers;
> - SELECT show_trgm('III');

> As a result, it seems there is a problem with trigrams generation and/or
> comparison when the Turkish locale is being used.

It looks like generate_trgm() is not considering the possibility that
case-folding will make the string physically longer, so you get a buffer
overrun when any of these I-containing strings are converted to trigrams.
Will fix, thanks for the report!

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <10064.1389629385@sss.pgh.pa.us>
Permalink:  ../10064.1389629385@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10064.1389629385@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ufuk@paralaus.com
  Subject: Re: BUG #8821: pg_trgm segfault with Turkish locale database
  In-Reply-To: <10064.1389629385@sss.pgh.pa.us>
  References: <20140113125641.30125.40578@wrigleys.postgresql.org> <10064.1389629385@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox