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.