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

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 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
    • None
    • SQL
    • Normal
    • 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

            Unassigned Unassigned
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: