Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
10.3.1.4, 10.4.1.3
-
None
-
None
Description
Queries like following should fail in a territory based database if the current schema is a user schema
SELECT TABLENAME FROM SYS.SYSTABLES WHERE LOCATE('LOOKFORME', TABLENAME) != 0;
SELECT TABLENAME FROM SYS.SYSTABLES WHERE TRIM('E' from TABLENAME) = TABLENAME;
This is because the collation type of the first operand for both LOCATE and TRIM is territory based but the second parameter has collation of UCS_BASIC and hence such a comparison should not be allowed. In order to fix this, we need code like following in TernaryOperatorNode
//Make sure that the string operands are comparable ie their collation
//should be considered in deciding whether the string operands can be
//compared with each other
boolean cmp = leftOperand.getTypeServices().comparable(receiver.getTypeServices(),
true,
getClassFactory());
if (!cmp)
Attachments
Issue Links
- relates to
-
DERBY-1478 Add built in language based ordering and like processing to Derby
- Closed