Fujii Masao <masao.fu...@gmail.com> writes: > On Thu, Aug 9, 2012 at 2:28 AM, Tom Lane <t...@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 - Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers