Subject | Re: [IBO] Filter parser bugs |
---|---|
Author | tomjanczkadao |
Post date | 2008-04-24T07:50Z |
> Problems with #1: a collate clause is not legal syntax in a searchcondition. That string should be
>with using a CAST:
> 'FIELD1 CONTAINING ''abc'''
>
> If you need to force a collate order onto FIELD1, you might get away
> 'CAST(FIELD1 AS VARCHAR(99) CHARACTER SET WIN1250 COLLATE PXW_PLK)CONTAINING ''abc'''
> (substituting 99 for the declared length of FIELD1, of course!Collate clause is legal in where condition. And it works ok when applied
directly to where clause.
The problem is that parser adds an extra useless 'AND' between 'collate'
and 'containing' while converting from filter to where clause:
WHERE (FIELD1 collate pxw_plk AND CONTAINING ''abc'').
Collate is necessary for correctly filtering diacritical characters.
> >#2see how the parser handles them in each case? i.e.
> Could you try adding that pair of external parentheses yourself, to
>All cases raise exception as in original case.
> '(c(FIELD1)||c(FIELD2)||c(FIELD3) containing ''abc'')'
>
> and also
> '(c(FIELD1)||c(FIELD2)||c(FIELD3)) containing ''abc'''
> BTW, I can see that expression causing problems at the server if anyof those operands is nullable - although the IBO parser can't know
that...
c() is an udf function that returns empty string if a field value is
null, so it does not cause any problems at server.
Regards, Tomek
[Non-text portions of this message have been removed]