Re: bug of pg_trgm? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug of pg_trgm?
Date
Msg-id 27640.1344640500@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug of pg_trgm?  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao <masao.fujii@gmail.com> writes:
> On Thu, Aug 9, 2012 at 2:28 AM, Tom Lane <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: Doug Coleman
Date:
Subject: Re: macports and brew postgresql --universal builds
Next
From: Jeff Davis
Date:
Subject: Re: 16-bit page checksums for 9.2