[jira] [Updated] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-29 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-4041:
--
Attachment: AttributeHolder.patch

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: AttributeHolder.patch, commentedQueryRepro.out, 
> commentedQueryRepro.sql, modified_querynperepro.sql, querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> org.apache.derby.impl.sql.compile.SetOperatorNode.modifyAccessPath(SetOperatorNode.java:169)
> at 
> 

[jira] [Updated] (DERBY-6958) Clean up the Derby website

2017-09-26 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-6958:
--
Attachment: modified_index.diff

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
> Attachments: index.html, modified_index.diff
>
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DERBY-6958) Clean up the Derby website

2017-09-26 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-6958:
--
Attachment: (was: modified_index.diff)

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
> Attachments: index.html
>
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DERBY-6958) Clean up the Derby website

2017-09-26 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-6958:
--
Attachment: modified_index.diff

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
> Attachments: index.html, modified_index.diff
>
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DERBY-6958) Clean up the Derby website

2017-09-25 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16180236#comment-16180236
 ] 

Dimuthu Wickramanayake commented on DERBY-6958:
---

I guess the file you need to edit at first is what i did upload above. Can you 
tell me where i can find those files in the source code i got it using curl.

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
> Attachments: index.html
>
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DERBY-6958) Clean up the Derby website

2017-09-25 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-6958:
--
Attachment: index.html

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
> Attachments: index.html
>
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6958) Clean up the Derby website

2017-09-25 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6958:
-

Assignee: Dimuthu Wickramanayake

> Clean up the Derby website
> --
>
> Key: DERBY-6958
> URL: https://issues.apache.org/jira/browse/DERBY-6958
> Project: Derby
>  Issue Type: Improvement
>  Components: Web Site
>Affects Versions: 10.13.1.1
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
>
> The Derby website is stale and needs to be cleaned up. Here is an initial 
> list of things I want to clean up:
> 1) The copyright year in the page footer is 2015. That should be 2017. Extra 
> credit if we can parameterize the footer so that the copyright year is 
> automatically updated whenever we refresh the website with a new release.
> 2) The document references in the FAQ (http://db.apache.org/derby/faq.html) 
> are hard-coded. I just updated them from 10.7 doc references to be 10.13 
> references. But we should parameterize doc references across the Derby 
> website so that, again, they are updated whenever we refresh the website with 
> a new release.
> 3) I removed dead links in some of the top-level pages along with stale 
> information. We need to make a systematic pass through the whole website. 
> Extra credit if we can automate the location of dead links so that we can 
> clean up the website when we publish releases.
> 4) We need to remove material which addresses old issues which no-one cares 
> about any more.
> 5) Extra credit if we can cleanup the wiki similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6960) Cleanup LOOKAHEADS in parser production for ALTER TABLE ALTER COLUMN

2017-09-25 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6960:
-

Assignee: Dimuthu Wickramanayake

> Cleanup LOOKAHEADS in parser production for ALTER TABLE ALTER COLUMN
> 
>
> Key: DERBY-6960
> URL: https://issues.apache.org/jira/browse/DERBY-6960
> Project: Derby
>  Issue Type: Task
>  Components: SQL
>Affects Versions: 10.14.1.0
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
>
> The columnAlterClause() production has a lot of LOOKAHEADs. It is probably 
> possible to simplify this production and make it more readable.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16178002#comment-16178002
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

So this should have the error code ERROR XCY04:Invalid syntax for optimizer 
overrides. The syntax should be -- DERBY-PROPERTIES

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: commentedQueryRepro.out, commentedQueryRepro.sql, 
> modified_querynperepro.sql, querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> 

[jira] [Assigned] (DERBY-6908) CLONE - Incorrect error message in ij for disconnect with no active connections

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6908:
-

Assignee: Dimuthu Wickramanayake

> CLONE - Incorrect error message in ij for disconnect with no active 
> connections
> ---
>
> Key: DERBY-6908
> URL: https://issues.apache.org/jira/browse/DERBY-6908
> Project: Derby
>  Issue Type: Bug
>  Components: Tools
>Affects Versions: 10.2.2.0
>Reporter: M.A.D.M Mallikarachchi
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_5_2
>
> Using ij, before connecting to the database, when the disconnect command is 
> issued, the error message which is printed is:IJ ERROR: Unable to establish 
> connection
> bash-3.00# ij
> ij version 10.4
> ij> disconnect;
> IJ ERROR: Unable to establish connection
> The error message should be changed to "No connection available" for a better 
> understanding.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6908) CLONE - Incorrect error message in ij for disconnect with no active connections

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6908:
-

Assignee: (was: Dimuthu Wickramanayake)

> CLONE - Incorrect error message in ij for disconnect with no active 
> connections
> ---
>
> Key: DERBY-6908
> URL: https://issues.apache.org/jira/browse/DERBY-6908
> Project: Derby
>  Issue Type: Bug
>  Components: Tools
>Affects Versions: 10.2.2.0
>Reporter: M.A.D.M Mallikarachchi
>Priority: Minor
>  Labels: derby_triage10_5_2
>
> Using ij, before connecting to the database, when the disconnect command is 
> issued, the error message which is printed is:IJ ERROR: Unable to establish 
> connection
> bash-3.00# ij
> ij version 10.4
> ij> disconnect;
> IJ ERROR: Unable to establish connection
> The error message should be changed to "No connection available" for a better 
> understanding.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (DERBY-6963) Null pointer exception when properties are not in order

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake closed DERBY-6963.
-
Resolution: Duplicate

> Null pointer exception when properties are not in order
> ---
>
> Key: DERBY-6963
> URL: https://issues.apache.org/jira/browse/DERBY-6963
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.11.1.1
>Reporter: Dimuthu Wickramanayake
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>
> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6963) Null pointer exception when properties are not in order

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6963:
-

Assignee: (was: Dimuthu Wickramanayake)

> Null pointer exception when properties are not in order
> ---
>
> Key: DERBY-6963
> URL: https://issues.apache.org/jira/browse/DERBY-6963
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.11.1.1
>Reporter: Dimuthu Wickramanayake
>Priority: Minor
>
> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6963) Null pointer exception when properties are not in order

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6963:
-

Assignee: Dimuthu Wickramanayake

> Null pointer exception when properties are not in order
> ---
>
> Key: DERBY-6963
> URL: https://issues.apache.org/jira/browse/DERBY-6963
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.11.1.1
>Reporter: Dimuthu Wickramanayake
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>
> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (DERBY-6963) Null pointer exception when properties are not in order

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)
Dimuthu Wickramanayake created DERBY-6963:
-

 Summary: Null pointer exception when properties are not in order
 Key: DERBY-6963
 URL: https://issues.apache.org/jira/browse/DERBY-6963
 Project: Derby
  Issue Type: Bug
Affects Versions: 10.11.1.1
Reporter: Dimuthu Wickramanayake
Assignee: Dimuthu Wickramanayake
Priority: Minor


select count(*) from (select * from t1 union select * from t3 
--DERBY-PROPERTIES joinStrategy=HASH
) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
x2.e ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6667) Redundant word "referencing" in error message for deferred constraints.

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6667:
-

Assignee: Dimuthu Wickramanayake  (was: Rick Hillegas)

> Redundant word "referencing" in error message for deferred constraints.
> ---
>
> Key: DERBY-6667
> URL: https://issues.apache.org/jira/browse/DERBY-6667
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Reporter: Rick Hillegas
>Assignee: Dimuthu Wickramanayake
>Priority: Trivial
>  Labels: derby_backport_reject_10_10
> Fix For: 10.11.1.1
>
> Attachments: derby-6667-01-aa-removeRedundantWord.diff
>
>
> There is an extra "referencing" in the error message when committing a 
> violated deferred foreign key.
> {noformat}
> ij version 10.11
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table tprim
> (
>   a int primary key
> );
> 0 rows inserted/updated/deleted
> ij> create table tref
> (
>   a int,
>   constraint tref foreign key( a ) references tprim( a ) initially deferred
> );
> 0 rows inserted/updated/deleted
> ij> insert into tprim values ( 1 );
> 1 row inserted/updated/deleted
> ij> autocommit off;
> ij> insert into tref values ( 1 );
> 1 row inserted/updated/deleted
> ij> delete from tprim;
> 1 row inserted/updated/deleted
> ij> commit;
> ERROR 23516: The transaction was aborted because of a deferred constraint 
> violation: Foreign key 'TREF' defined on "APP"."TPRIM" referencing 
> referencing constraint 'SQL140716063201410' defined on "APP"."TPRIM", key 
> '(1)'.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (DERBY-6924) Documentation improvement

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-6924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake reassigned DERBY-6924:
-

Assignee: Dimuthu Wickramanayake

> Documentation improvement
> -
>
> Key: DERBY-6924
> URL: https://issues.apache.org/jira/browse/DERBY-6924
> Project: Derby
>  Issue Type: Improvement
>  Components: Documentation
>Affects Versions: 10.12.1.1
>Reporter: Aaron Seavers
>Assignee: Dimuthu Wickramanayake
>Priority: Trivial
>  Labels: documentation
>
> I noticed in the documentation on 
> https://builds.apache.org/job/Derby-docs/lastSuccessfulBuild/artifact/trunk/out/tools/index.html
>  that database URL is italicized only once on the page. "Establishing a 
> connection to a specific database is done by specifying a appropriate 
> database URL". I dont know if this is intended or if the URL should be 
> regular type



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DERBY-5487) Primary key disk pages not reclaimed when using SYSCS_UTIL.SYSCS_COMPRESS_TABLE with just the purge_rows option

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-5487:
--
Priority: Major  (was: Minor)

> Primary key disk pages not reclaimed when using 
> SYSCS_UTIL.SYSCS_COMPRESS_TABLE with just the purge_rows option
> ---
>
> Key: DERBY-5487
> URL: https://issues.apache.org/jira/browse/DERBY-5487
> Project: Derby
>  Issue Type: Bug
>  Components: Store
>Affects Versions: 10.8.1.2
> Environment: Windows 7, Embedded Derby mode
>Reporter: Sundar Narayanaswamy
>  Labels: derby_triage10_8
> Attachments: ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg, 
> DerbyInPlaceCompress.java
>
>
> When I continuously insert data, delete the inserted data then compress with 
> purge_rows option in a loop, space is not reclaimed from the primary key 
> file. The inserts are committed every 1 rows, deletes committed every 
> 5 rows. All the rows that were inserted are deleted. The primary key 
> values continually increase (across the inserts) . All the activities occur 
> on a single thread. Included below is the space table output after each 
> iteration in the loop:
> As can be seen below and in the screenshot attached, the NumAllocatedpages 
> for SQL111029001155930 is continuously increasing. This increase does not 
> happen if the primary key values are reset after each iteration (ie, primary 
> key values for new inserts are in the same range as deleted rows). 
> Iteration: 0
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8031
>4096  3289088 
> SQL111029003533400  1 238 31 179  
>4096  126976  
> LOC_INDEX   1 211 185119  
>4096  757760  
> Database size: 12993 KB
> Iteration: 1
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8161
>4096  3342336 
> SQL111029003533400  1 324 192200  
>4096  786432  
> LOC_INDEX   1 1   4061
>4096  1662976 
> Database size: 17112 KB
> Iteration: 2
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 7   8101
>4096  3317760 
> SQL111029003533400  1 579 23 294  
>4096  94208   
> LOC_INDEX   1 394 28 2
>4096  114688  
> Database size: 22821 KB
> Iteration: 3
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8160
>4096  3342336 
> SQL111029003533400  1 631 227451  
>4096  929792  
> LOC_INDEX   1 5   4373
>4096  1789952 
> Database size: 18054 KB
> Iteration: 4
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8170
>4096  3346432 
> SQL111029003533400  1 735 174460  
>4096  712704  
> LOC_INDEX   1 1   4411
>4096  1806336 
> Database size: 15632 KB
> Iteration: 5
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 4   8140
>4096  3334144 
> SQL111029003533400  1 992 21 690  
>4096  86016   
> LOC_INDEX   1 378 64 127  
>4096  262144  
> Database size: 25633 KB
> Iteration: 6
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize 

[jira] [Updated] (DERBY-5487) Primary key disk pages not reclaimed when using SYSCS_UTIL.SYSCS_COMPRESS_TABLE with just the purge_rows option

2017-09-23 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-5487:
--
Priority: Minor  (was: Major)

> Primary key disk pages not reclaimed when using 
> SYSCS_UTIL.SYSCS_COMPRESS_TABLE with just the purge_rows option
> ---
>
> Key: DERBY-5487
> URL: https://issues.apache.org/jira/browse/DERBY-5487
> Project: Derby
>  Issue Type: Bug
>  Components: Store
>Affects Versions: 10.8.1.2
> Environment: Windows 7, Embedded Derby mode
>Reporter: Sundar Narayanaswamy
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg, 
> DerbyInPlaceCompress.java
>
>
> When I continuously insert data, delete the inserted data then compress with 
> purge_rows option in a loop, space is not reclaimed from the primary key 
> file. The inserts are committed every 1 rows, deletes committed every 
> 5 rows. All the rows that were inserted are deleted. The primary key 
> values continually increase (across the inserts) . All the activities occur 
> on a single thread. Included below is the space table output after each 
> iteration in the loop:
> As can be seen below and in the screenshot attached, the NumAllocatedpages 
> for SQL111029001155930 is continuously increasing. This increase does not 
> happen if the primary key values are reset after each iteration (ie, primary 
> key values for new inserts are in the same range as deleted rows). 
> Iteration: 0
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8031
>4096  3289088 
> SQL111029003533400  1 238 31 179  
>4096  126976  
> LOC_INDEX   1 211 185119  
>4096  757760  
> Database size: 12993 KB
> Iteration: 1
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8161
>4096  3342336 
> SQL111029003533400  1 324 192200  
>4096  786432  
> LOC_INDEX   1 1   4061
>4096  1662976 
> Database size: 17112 KB
> Iteration: 2
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 7   8101
>4096  3317760 
> SQL111029003533400  1 579 23 294  
>4096  94208   
> LOC_INDEX   1 394 28 2
>4096  114688  
> Database size: 22821 KB
> Iteration: 3
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8160
>4096  3342336 
> SQL111029003533400  1 631 227451  
>4096  929792  
> LOC_INDEX   1 5   4373
>4096  1789952 
> Database size: 18054 KB
> Iteration: 4
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 1   8170
>4096  3346432 
> SQL111029003533400  1 735 174460  
>4096  712704  
> LOC_INDEX   1 1   4411
>4096  1806336 
> Database size: 15632 KB
> Iteration: 5
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> NumUnFilledPagesPageSize  EstimSpaceSaving
> LOCATION0 4   8140
>4096  3334144 
> SQL111029003533400  1 992 21 690  
>4096  86016   
> LOC_INDEX   1 378 64 127  
>4096  262144  
> Database size: 25633 KB
> Iteration: 6
> ConglomerateNameIsIndex   NumAllocatedPages   NumFreePages   
> 

[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-16 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16169142#comment-16169142
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

Okay i will look at them. Thank you very much bryan for spending your
valuable time to analyse this




> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: commentedQueryRepro.out, commentedQueryRepro.sql, 
> modified_querynperepro.sql, querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> org.apache.derby.impl.sql.compile.SetOperatorNode.modifyAccessPath(SetOperatorNode.java:169)
> at 
> 

[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-11 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16161018#comment-16161018
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

I uploaded the code without the NPE. There i haven't corrected any misplacing 
words i have just write the whole command in one line. So what i feel is this 
is not an issue. 

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: modified_querynperepro.sql, querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> 

[jira] [Updated] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-11 Thread Dimuthu Wickramanayake (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Wickramanayake updated DERBY-4041:
--
Attachment: modified_querynperepro.sql

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: modified_querynperepro.sql, querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> org.apache.derby.impl.sql.compile.SetOperatorNode.modifyAccessPath(SetOperatorNode.java:169)
> at 
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.modifyAccessPath(ProjectRestrictNode.java:718)
> at 
> 

[jira] [Comment Edited] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-07 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16156549#comment-16156549
 ] 

Dimuthu Wickramanayake edited comment on DERBY-4041 at 9/7/17 6:38 AM:
---

Actually the statement "I think the directive is misplaced and should come 
after the x1 (c, d) but it shouldn't throw an NPE" is wrong. The reason for the 
null pointer exception as i found is the statement is in 2 rows. So when i gave 
that statement in one line there was no error. So this is a syntax error not a 
null pointer exception. Keeping the directive in the place does no harm.


was (Author: dimuthuw):
Actually the statement "I think the directive is misplaced and should come 
after the x1 (c, d) but it shouldn't throw an NPE" is wrong. The reason for the 
null pointer exception as i found is the statement is in 2 rows. So when i gave 
that statement in one line there was no error. So this is a syntax error not a 
null pointer exception.

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> 

[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-09-07 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16156549#comment-16156549
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

Actually the statement "I think the directive is misplaced and should come 
after the x1 (c, d) but it shouldn't throw an NPE" is wrong. The reason for the 
null pointer exception as i found is the statement is in 2 rows. So when i gave 
that statement in one line there was no error. So this is a syntax error not a 
null pointer exception.

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> 

[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-07-18 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092479#comment-16092479
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

Thank you very much Bryan.

> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Assignee: Dimuthu Wickramanayake
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> org.apache.derby.impl.sql.compile.SetOperatorNode.modifyAccessPath(SetOperatorNode.java:169)
> at 
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.modifyAccessPath(ProjectRestrictNode.java:718)
> at 
> 

[jira] [Commented] (DERBY-4041) NullPointerException on query with misplaced DERBY-PROPERTIES clause

2017-07-18 Thread Dimuthu Wickramanayake (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16091202#comment-16091202
 ] 

Dimuthu Wickramanayake commented on DERBY-4041:
---

i LIKE TO WORK ON THIS ISSUE


> NullPointerException on query with misplaced DERBY-PROPERTIES clause
> 
>
> Key: DERBY-4041
> URL: https://issues.apache.org/jira/browse/DERBY-4041
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1
>Reporter: Kathey Marsden
>Priority: Minor
>  Labels: derby_triage10_8
> Attachments: querynperepro.sql
>
>
> The following sql  throws  a NullPointerException
> ij> CREATE TABLE "APP"."T1" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1, 2), (2, 4), (3, 6), (4, 8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T2" ("I" INTEGER, "J" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t2 values (1, 2), (2, -4), (3, 6), (4, -8), (5, 10);
> 5 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T3" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into T3 values (1,1), (2,2), (3,3), (4,4), (6, 24),
>   (7, 28), (8, 32), (9, 36), (10, 40);
> 9 rows inserted/updated/deleted
> ij> insert into t3 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t3 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> CREATE TABLE "APP"."T4" ("A" INTEGER, "B" INTEGER);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values (3, 12), (4, 16);
> 2 rows inserted/updated/deleted
> ij> insert into t4 (a) values 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
> 10 rows inserted/updated/deleted
> ij> update t4 set b = 2 * a where a > 10;
> 10 rows inserted/updated/deleted
> ij> select count(*) from (select * from t1 union select * from t3 
> --DERBY-PROPERTIES joinStrategy=HASH
> ) x1 (c, d), (select * from t2 union select * from t4) x2 (e, f) where x1.c = 
> x2.e ;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
> at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
> at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
> at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
> at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)
> at 
> org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)
> at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
> at org.apache.derby.impl.tools.ij.Main.go(Main.java:210)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:177)
> at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
> at org.apache.derby.tools.ij.main(ij.java:59)
> Caused by: java.sql.SQLException: Java exception: ': 
> java.lang.NullPointerException'.
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:11
> 9)
> at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.derby.impl.sql.compile.OptimizerImpl.getFinalCost(OptimizerImpl.java:2498)
> at 
> org.apache.derby.impl.sql.compile.SelectNode.getFinalCostEstimate(SelectNode.java:1987)
> at 
> org.apache.derby.impl.sql.compile.UnionNode.getFinalCostEstimate(UnionNode.java:653)
> at 
> org.apache.derby.impl.sql.compile.SetOperatorNode.modifyAccessPath(SetOperatorNode.java:169)
> at 
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.modifyAccessPath(ProjectRestrictNode.java:718)
> at 
>