Re: bug of pg_trgm?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug of pg_trgm?
Date: 2012-08-10 23:15:00
Message-ID: 27640.1344640500@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> On Thu, Aug 9, 2012 at 2:28 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I'm also inclined to think that we should remove *both* flag resets
>> before the second loop. The logic here is that we are reprocessing
>> the same character seen in the last iteration of the first loop,
>> right? So the flag state ought to remain the same.

> No. ISTM that in_wildcard_meta must be reset before the second loop.
> Because the meaning of that flag in the first loop is different from that in
> the second loop. The former and the latter indicate whether the search
> string has *heading* and *tailing* wildcard character, respectively. No?

Oh, good point. Maybe it would be clearer to use two separate
flag variables?

The thought I'd had was that the flag would necessarily get reset
during the first iteration of the second loop, which means it all
ends up the same anyway. But if we want to think of the flag as
meaning two different things for the two loops, I'd be inclined to
use two variables.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2012-08-10 23:16:43 Re: 16-bit page checksums for 9.2
Previous Message Doug Coleman 2012-08-10 23:12:08 Re: macports and brew postgresql --universal builds