Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6029

ClassCastException or assert when mixing system tables and user tables in LIKE ... ESCAPE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2, 10.8.2.2, 10.8.3.0, 10.9.1.0, 10.10.1.1
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      ij> connect 'jdbc:derby:memory:db;create=true;territory=en_US;collation=TERRITORY_BASED';
      ij> create table t(x varchar(20), y varchar(20));
      0 rows inserted/updated/deleted
      ij> insert into t values ('abc', 'def');
      1 row inserted/updated/deleted
      ij> select * from t, sysibm.sysdummy1 where x like y escape ibmreqd;
      X |Y |IBM&
      ----------------------------------------------
      ERROR 38000: The exception 'java.lang.ClassCastException: org.apache.derby.iapi.types.SQLChar cannot be cast to org.apache.derby.iapi.types.CollationElementsInterface' was thrown while evaluating an expression.
      ERROR XJ001: Java exception: 'org.apache.derby.iapi.types.SQLChar cannot be cast to org.apache.derby.iapi.types.CollationElementsInterface: java.lang.ClassCastException'.

      Or, when using sane jars:

      ij> select * from t, sysibm.sysdummy1 where x like y escape ibmreqd;
      X |Y |IBM&
      ----------------------------------------------
      ERROR 38000: The exception 'org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED All three operands must be instances of CollationElementsInterface' was thrown while evaluating an expression.
      ERROR XJ001: Java exception: 'ASSERT FAILED All three operands must be instances of CollationElementsInterface: org.apache.derby.shared.common.sanity.AssertFailure'.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              knutanders Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: