From:
Andrew Dunstan <andrew(at)dunslane(dot)net>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Zeugswetter Andreas ADI SD <ZeugswetterA(at)spardat(dot)at>,
andrew(at)supernews(dot)com,
"Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject:
Re: [HACKERS] like/ilike improvements
Date:
2007-06-02 02:05:32
Message-ID:
4660D06C.9010104@dunslane.net (view raw or flat )
Thread:
2007-05-22 15:58:33 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-22 16:12:51 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-22 16:30:37 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-22 16:51:51 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-22 17:01:14 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-22 17:40:36 from Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
2007-05-22 19:04:32 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-22 22:37:24 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-23 14:34:06 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-23 14:41:09 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-23 14:52:44 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-23 16:00:54 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-23 16:07:10 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-24 00:36:17 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-24 00:36:17 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-24 17:17:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-24 18:02:35 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-24 23:32:19 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 01:26:19 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-25 01:56:58 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 02:03:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-25 03:20:51 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-25 03:34:13 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 05:20:16 from mark(at)mark(dot)mielke(dot)cc
2007-05-25 11:11:32 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 03:21:35 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 08:16:59 from "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
2007-05-25 10:55:32 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-05-25 13:47:15 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-01 03:39:30 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-06-01 05:07:29 from ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
2007-06-01 11:16:16 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-06-01 22:58:18 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-01 22:54:04 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-02 02:05:32 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-06-02 02:15:13 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-05-25 13:42:18 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-23 05:55:04 from db(at)zigo(dot)dhs(dot)org
2007-05-22 18:44:25 from mark(at)mark(dot)mielke(dot)cc
2007-05-22 17:38:48 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-19 15:00:24 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-19 18:39:29 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-09-19 20:12:56 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-19 22:08:59 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-20 00:14:56 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-09-20 08:38:48 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-20 13:42:20 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-09-20 15:42:41 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-09-21 08:53:27 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-21 09:41:38 from ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
2007-09-21 10:00:31 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-09-21 17:12:05 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-21 17:41:08 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-09-21 20:24:42 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-09-22 08:37:22 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
2007-09-22 11:20:24 from "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
Lists:
pgsql-hackers pgsql-patches
Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> OK, here is a patch that I think incorporates all the ideas discussed
>> (including part of Mark Mielke's suggestion about optimising %_). There
>> is now no special treatment of UTF8 other than its use of a faster
>> NextChar macro.
>>
>
> Looks mostly pretty good. I would suggest replacing tests "tlen == 0"
> and "plen == 0" with "<= 0", just so the code doesn't go completely
> insane if presented with invalidly-encoded data that causes it to step
> beyond the end of data. Also, this comment is not really good enough:
>
>
>> ! /*
>> ! * It is safe to use NextByte instead of NextChar here, even for
>> ! * multi-byte character sets, because we are not following
>> ! * immediately after a wildcard character.
>> ! */
>> ! NextByte(t, tlen);
>> ! NextByte(p, plen);
>> }
>>
>
> I'd suggest adding something like "If we are in the middle of a
> multibyte character, we must already have matched at least one byte of
> the character from both text and pattern; so we cannot get out-of-sync
> on character boundaries. And we know that no backend-legal encoding
> allows ASCII characters such as '%' to appear as non-first bytes of
> characters, so we won't mistakenly detect a new wildcard."
>
>
>
Done, and committed.
cheers
andrew
In response to
Responses
pgsql-hackers by date
Next :From: Bruce MomjianDate: 2007-06-02 02:15:13
Subject : Re: [HACKERS] like/ilike improvements
Previous :From : Andrew DunstanDate : 2007-06-02 01:11:54
Subject : Re: syslogger line-end processing infelicity
pgsql-patches by date
Next :From: Bruce MomjianDate: 2007-06-02 02:15:13
Subject : Re: [HACKERS] like/ilike improvements
Previous :From : Tom LaneDate : 2007-06-01 22:58:18
Subject : Re: [HACKERS] like/ilike improvements