According to the Developer's Guide section titled "Character-based
collation in Derby", the LIKE operator behaves differently than the =
operator. That is, if you are using a territory-based collation, two
strings might = one another but not be LIKE one another (and vice-versa).
In the meantime, according to the section in the Tuning Guide titled
"Character string beginning with constant", LIKE expressions which begin
with a constant (followed by a wildcard) can be transformed into
indexable expressions involving the ">=" and "<" operators.
To my muddled understanding, it seems that one of the following occurs:
1) The LIKE optimizations are disabled if you are using territory-based
collation
or
2) a LIKE expression may return different results depending on your
indexes and/or the presence of trailing wildcards in your LIKE expression.
(1) seems like a performance issue which needs to be documented. (2)
seems like a correctness problem. What is the behavior that we expect?
Thanks,
-Rick