Skip Menu |

This queue is for tickets about the DBIx-SearchBuilder CPAN distribution.

Report information
The Basics
Id: 84824
Status: rejected
Priority: 0/
Queue: DBIx-SearchBuilder

People
Owner: Nobody in particular
Requestors: cloos [...] netcologne.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: LIKE search strings are always surrounded by %s
A comment in https://github.com/bestpractical/dbix-searchbuilder/blob/master/lib/DBIx/SearchBuilder.pm#L754 already mention that this is an bug. Any chance to fix this? I think the best way would be to not add the %s if the string already contains '%' or '_'.
Subject: Re: [rt.cpan.org #84824] LIKE search strings are always surrounded by %s
Date: Wed, 24 Apr 2013 08:47:04 -0700
To: bug-DBIx-SearchBuilder [...] rt.cpan.org
From: Thomas Sibley <tsibley [...] cpan.org>
On 04/24/2013 02:33 AM, Christian Loos via RT wrote: Show quoted text
> A comment in > https://github.com/bestpractical/dbix-searchbuilder/blob/master/lib/DBIx/SearchBuilder.pm#L754 > already mention that this is an bug. > > Any chance to fix this? > > I think the best way would be to not add the %s if the string already > contains '%' or '_'.
The MATCH operator doesn't surround the value with %s. LIKE is kept as-is for back compat, I expect.
Am Mi 24. Apr 2013, 11:47:48, TSIBLEY schrieb: Show quoted text
> The MATCH operator doesn't surround the value with %s. > > LIKE is kept as-is for back compat, I expect.
I noticed in RT (4.0.10) that searching for a custom field with "CF.{Bar} LIKE '__.__.____'" generate an SQL query with "ObjectCustomFieldValues_1.Content LIKE '%__.__.____%'" which isn't what I expected and thought that this was DBIx::SearchBuilder's fault. But it seams more that the problem is located within RT. I will track down this a little bit more and file a bug report against RT.
Subject: Re: [rt.cpan.org #84824] LIKE search strings are always surrounded by %s
Date: Mon, 29 Apr 2013 12:30:05 -0700
To: bug-DBIx-SearchBuilder [...] rt.cpan.org
From: Thomas Sibley <tsibley [...] cpan.org>
On 04/29/2013 02:22 AM, Christian Loos via RT wrote: Show quoted text
> Am Mi 24. Apr 2013, 11:47:48, TSIBLEY schrieb:
>> The MATCH operator doesn't surround the value with %s. >> >> LIKE is kept as-is for back compat, I expect.
> > I noticed in RT (4.0.10) that searching for a custom field with > "CF.{Bar} LIKE '__.__.____'" generate an SQL query with > "ObjectCustomFieldValues_1.Content LIKE '%__.__.____%'" which isn't what > I expected and thought that this was DBIx::SearchBuilder's fault. > But it seams more that the problem is located within RT. > > I will track down this a little bit more and file a bug report against RT.
No, SB surrounds LIKE values with %. It's documented. MATCHES is documented to be what you want if you don't want this automatic behaviour. LIKE has been as it is for so long that I don't think it will be changed. It's just a quirk of SB. Note that RT's TicketSQL, however, doesn't support the MATCHES operator. You'd have to add it.