[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-01-08 Thread Donatas Ciuksys (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556894#action_12556894
 ] 

Donatas Ciuksys commented on DERBY-3303:


SQL that fails:

SELECT MAX(Preke.pavadinimas) AS PAVADINIMAS, MAX(Preke.barkodas) AS BARKODAS, 
MAX(Preke.kiekis) AS KIEKIS, SUM(Irasas.faktinis_kiekis) AS 
FAKTINIS_KIEKIS,
SUM(Irasas.faktinis_kiekis)-MAX(Preke.kiekis) AS TRUKUMAS
FROM Preke LEFT JOIN Irasas ON Preke.unikalus_kodas = Irasas.unikalus_kodas
JOIN Irasu_Blokas ON Irasas.irasu_blokas = Irasu_Blokas.id
WHERE Irasu_Blokas.inventorizacija = 1
GROUP BY Irasas.unikalus_kodas  
ORDER BY ABS(SUM(Irasas.faktinis_kiekis) - MAX(Preke.kiekis)) DESC

> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.2.1
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Priority: Blocker
> Attachments: db.zip
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-01-08 Thread A B (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556925#action_12556925
 ] 

A B commented on DERBY-3303:


Thank you *very* much for the reproduction script, Donatas.

I ran your script against trunk and the bug reproduces there, as well.  Using a 
sane build the query fails with the following assertion error:

org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED column 
ordering error
at 
org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
at 
org.apache.derby.impl.store.access.sort.MergeSort.initialize(MergeSort.java:535)
at 
org.apache.derby.impl.store.access.sort.ExternalSortFactory.createSort(ExternalSortFactory.java:216)
at 
org.apache.derby.impl.store.access.RAMTransaction.createSort(RAMTransaction.java:1711)
at 
org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(SortResultSet.java:301)
at 
org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:268)

The query runs without error at svn # 516453, but fails with # 516454.  So it 
looks like this is related to DERBY-681.

> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.2.1
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Priority: Blocker
> Attachments: db.zip, ddl.sql
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-02-13 Thread A B (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568780#action_12568780
 ] 

A B commented on DERBY-3303:


A simpler way to reproduce the problem on trunk:

  create table t1 (i int, j int, k int);
  insert into t1 values (1, 1, 2), (1, 3, 3), (2, 3, 1), (2, 2, 4);

  -- Works.
  select sum(k) as s from t1 group by i order by 1;

  -- Works.
  select sum(k) as s from t1 group by i order by s;

  -- Fails (ArrayIndexOutOfBounds / ASSERT); should fail with ERROR 42X77...
  select sum(k) as s from t1 group by i order by 2;

  -- Fails (ArrayIndexOutOfBounds / ASSERT)
  select sum(k) as s from t1 group by i order by abs(1);

  -- Fails (ArrayIndexOutOfBounds / ASSERT)
  select sum(k) as s from t1 group by i order by sum(k);

> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.2.1
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Priority: Blocker
> Attachments: db.zip, ddl.sql
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-02-15 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569369#action_12569369
 ] 

Bryan Pendleton commented on DERBY-3303:


Hi Army, thanks for working on this problem. I'll try to have a look at your 
patch over the weekend (little busy today).

> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Assignee: A B
>Priority: Blocker
> Attachments: d3303_v1.patch, db.zip, ddl.sql
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-02-15 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569449#action_12569449
 ] 

Bryan Pendleton commented on DERBY-3303:


Hi Army, things lightened up a bit this afternoon so I had a look at the patch.

The comments are excellent! Thank you very much; they make it very clear.
Your change seems correct to me. The code is also considerably cleaner
by using visibleSize(), and reads better.

Here are a few suggestions; none are worth holding up the patch for.

- It might be nice to format your detailed comment for resolveAddedColumns()
as a true javadoc comment for that method (which currently has no javadoc),
rather than as an inline comment.

- I recalled from my investigations with DERBY-1861 that some of this code
gets exercised by various combinations of including "*" in the select list, and
using expressions in the order by list. So I tried a couple more test cases.
They didn't find any additional problems, but here they are anyway, in case you
think that they might add value to the regression suite:

  select d3303.i as old_i, sum(d3303.k), d3303.* from d3303 group by k, i, j 
order by j;

  select d3303.i as old_i, sum(d3303.k), d3303.* from d3303 group by k, i, j 
order by 4;

  select d3303.i as old_i, sum(d3303.k), d3303.* from d3303 group by k, i, j 
order by k+2;

+1 to commit.



> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Assignee: A B
>Priority: Blocker
> Attachments: d3303_v1.patch, db.zip, ddl.sql
>
>
> 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 = 
> NF01.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.apa

[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-02-15 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569510#action_12569510
 ] 

Bryan Pendleton commented on DERBY-3303:


Patch 2 looks great, and changing that extra SUM(J) in the comments
does indeed make it clearer. I have no additional suggestions to offer.


> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Assignee: A B
>Priority: Blocker
> Attachments: d3303_v1.patch, d3303_v2.patch, db.zip, ddl.sql
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (DERBY-3303) ArrayIndexOutOfBoundsException at MergeSort.compare

2008-02-21 Thread Donatas Ciuksys (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1257#action_1257
 ] 

Donatas Ciuksys commented on DERBY-3303:


Sorry, I have migrated to DB2 already (have changed jdbc driver, connection 
url, and so on), so I don't have development environment suitable for Derby any 
more. And I don't know, how to build version 10.3.2.2. I have attached db 
scripts, it shouldn't be difficult to run them and check whether this issue 
still holds.

Good luck.

> ArrayIndexOutOfBoundsException at MergeSort.compare
> ---
>
> Key: DERBY-3303
> URL: https://issues.apache.org/jira/browse/DERBY-3303
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0
> Environment: -- Java Information --
> Java Version:1.6.0_03
> Java Vendor: Sun Microsystems Inc.
> Java home:   D:\Programs\Java\jre1.6.0_03
> Java classpath:  derbytools.jar
> OS name: Windows XP
> OS architecture: x86
> OS version:  5.1
> Java user name:  Donatas
> Java user home:  C:\Documents and Settings\Donatas
> Java user dir:   d:\java\derby-10.3.2.1\lib
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> - Derby Information 
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [D:\java\derby-10.3.2.1\lib\derbytools.jar] 10.3.2.1 - (599110)
> --
> - Locale Information -
> --
>Reporter: Donatas Ciuksys
>Assignee: A B
>Priority: Blocker
> Fix For: 10.3.2.2, 10.4.0.0
>
> Attachments: d3303_10_3_merge.patch, d3303_v1.patch, d3303_v2.patch, 
> db.zip, ddl.sql
>
>
> 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 = 
> NF01.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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.