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

ArrayIndexOutOfBoundsException at MergeSort.compare

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.3.2.1, 10.4.1.3
    • Fix Version/s: 10.3.3.0, 10.4.1.3
    • Component/s: SQL
    • Labels:
      None
    • Environment:
    • Urgency:
      Normal
    • Bug behavior facts:
      Regression

      Description

      Derby throws ArrayIndexOutOfBoundsException when I try to execute SQL query shown below.

      This is a regression, since Derby 10.2.2.0 executes this query without problems.

      Attached are DDL statements to create DB tables, and database itself (with data).

      2008-01-08 12:32:34.461 GMT Thread[DRDAConnThread_5,6,derby.daemons] (XID = 1497), (SESSIONID = 0), (DATABASE = InventorizacijaDB), (DRDAID = NF000001.G46A-666250070078662256

      {1}

      ), Failed Statement is: select MAX(preke0_.BARKODAS) as col_0_0_, MAX(preke0_.PAVADINIMAS) as col_1_0_, MAX(preke0_.KIEKIS) as col_2_0_, SUM(irasas1_.FAKTINIS_KIEKIS) as col_3_0_ from PREKE preke0_, IRASAS irasas1_, IRASU_BLOKAS irasubloka2_ where irasas1_.IRASU_BLOKAS=irasubloka2_.ID and preke0_.UNIKALUS_KODAS=irasas1_.UNIKALUS_KODAS and irasubloka2_.INVENTORIZACIJA=? group by irasas1_.UNIKALUS_KODAS order by abs(SUM(irasas1_.FAKTINIS_KIEKIS)-MAX(preke0_.KIEKIS)) DESC with 1 parameters begin parameter #1: 1 :end parameter
      java.lang.ArrayIndexOutOfBoundsException: 5
      at org.apache.derby.impl.store.access.sort.MergeSort.compare(Unknown Source)
      at org.apache.derby.impl.store.access.sort.SortBuffer.insert(Unknown Source)
      at org.apache.derby.impl.store.access.sort.MergeInserter.insert(Unknown Source)
      at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source)
      at org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
      at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)

        Attachments

        1. ddl.sql
          4 kB
          Donatas Ciuksys
        2. db.zip
          240 kB
          Donatas Ciuksys
        3. d3303_v2.patch
          12 kB
          A B
        4. d3303_v1.patch
          10 kB
          A B
        5. d3303_10_3_merge.patch
          12 kB
          A B

          Issue Links

            Activity

              People

              • Assignee:
                army A B
                Reporter:
                donatasc Donatas Ciuksys
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: