Subject | Re[2]: string right truncation error with LIKE predicate and UTF8 DB |
---|---|
Author | Рустам Муса-Ахунов |
Post date | 2017-11-03T09:13:04Z |
> > This query fails:I think, there is no DSQL error - LIKE predicate must correctly process
> > select * from TABLE1 where FIELD1 like 'абв';
>
>
> The "bug" here is that the message for all string input errors is the
> same. Transliteration of the input argument in the failing query
> would occur as in your third query above if the LIKE argument was
> valid. IMHO, it should give an invalid DSQL error, not that generic
> string error.
arguments without mask symbols, as he do this for 'abc' (or 'абв' when DB
default charset not UTF8). Not sure, but think that SQL standard not define
error for this case of LIKE.
> If you wanted to pass a query like that, you should use STARTING [WITH]:Yes, I also came to this solution, more correct is just FIELD1 = 'абв'.
> select * from TABLE1 where FIELD1 STARTING WITH 'абв';
We call this 'spike'. There is cases where this is impossible or difficult:
- this is impossible, where used third party components without sources
(like EhLib for Delphi, where LIKE used in grid filter; we fix this in sources),
or used third party applications.
- requires additional processing, when we allow users of our client application
perform data searching with LIKE (user can enter search pattern with or without '%').