[jira] [Comment Edited] (DERBY-5261) NetworkServerControl prints usage message twice on some errors

2017-07-13 Thread INDIKA KUMARA (JIRA)

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

INDIKA KUMARA edited comment on DERBY-5261 at 7/13/17 1:52 PM:
---

I have fixed DERBY-5261 bug.
When it is run with the command  "java -jar derbynet.jar abc" it give same 
error twice. I searched what was the error. I was able to find it in java file 
"NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print 
 in the method "private int findCommand(String [] args)"(line 2476) and calling 
place of it(line 2309). after I commented line 2476 and test it again with the 
command "java -jar derbynet.jar abc" then it print error message once only.

I attach patch file with this.


Index: drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
===
--- drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(revision 1800176)
+++ drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(working copy)
@@ -2473,8 +2473,6 @@
 }
 
 // didn't find command
-consolePropertyMessage("DRDA_UnknownCommand.U", 
-(String) commandArgs.firstElement());
 }
 } catch (Exception e) {
 if (e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR))


was (Author: kumara1234):
I have fixed DERBY-5261 bug.
When it is run with the command  "java -jar derbynet.jar abc" it give same 
error twice. I searched what was the error. I was able to find it in java file 
"NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print 
 in the method "private int findCommand(String [] args)"(line 2476) and calling 
place of it(line 2309). after I commented line 2476 and test it again with the 
command "java -jar derbynet.jar abc" then it print error message once only.

I attach patch file with this.


Index: drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
===
--- drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(revision 1800176)
+++ drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(working copy)
@@ -2473,8 +2473,6 @@
 }
 
 // didn't find command
-consolePropertyMessage("DRDA_UnknownCommand.U", 
-(String) commandArgs.firstElement());
 }
 } catch (Exception e) {
 if (e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR))

> NetworkServerControl prints usage message twice on some errors
> --
>
> Key: DERBY-5261
> URL: https://issues.apache.org/jira/browse/DERBY-5261
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.1.2
>Reporter: Knut Anders Hatlen
>Assignee: INDIKA KUMARA
>Priority: Minor
>  Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message 
> will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an 
> option. For example "java -jar derbynet start -p" (no port number).



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


[jira] [Comment Edited] (DERBY-5261) NetworkServerControl prints usage message twice on some errors

2017-07-13 Thread INDIKA KUMARA (JIRA)

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

INDIKA KUMARA edited comment on DERBY-5261 at 7/13/17 1:50 PM:
---

I have fixed DERBY-5261 bug.
When it is run with the command  "java -jar derbynet.jar abc" it give same 
error twice. I searched what was the error. I was able to find it in java file 
"NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print 
 in the method "private int findCommand(String [] args)"(line 2476) and calling 
place of it(line 2309). after I commented line 2476 and test it again with the 
command "java -jar derbynet.jar abc" then it print error message once only.

I attach patch file with this.


Index: drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
===
--- drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(revision 1800176)
+++ drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java   
(working copy)
@@ -2473,8 +2473,6 @@
 }
 
 // didn't find command
-consolePropertyMessage("DRDA_UnknownCommand.U", 
-(String) commandArgs.firstElement());
 }
 } catch (Exception e) {
 if (e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR))


was (Author: kumara1234):
I have fixed DERBY-5261 bug.
When it is run with the command  "java -jar derbynet.jar abc" it give same 
error twice. I searched what was the error. I was able to find it in java file 
"NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print 
 in the method "private int findCommand(String [] args)"(line 2476) and calling 
place of it(line 2309). after I commented line 2476 and test it again with the 
command "java -jar derbynet.jar abc" then it print error message once only.

I attach patch file with this.

> NetworkServerControl prints usage message twice on some errors
> --
>
> Key: DERBY-5261
> URL: https://issues.apache.org/jira/browse/DERBY-5261
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.1.2
>Reporter: Knut Anders Hatlen
>Assignee: INDIKA KUMARA
>Priority: Minor
>  Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message 
> will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an 
> option. For example "java -jar derbynet start -p" (no port number).



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


[jira] [Commented] (DERBY-5261) NetworkServerControl prints usage message twice on some errors

2017-07-13 Thread INDIKA KUMARA (JIRA)

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

INDIKA KUMARA commented on DERBY-5261:
--

I have fixed DERBY-5261 bug.
When it is run with the command  "java -jar derbynet.jar abc" it give same 
error twice. I searched what was the error. I was able to find it in java file 
"NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print 
 in the method "private int findCommand(String [] args)"(line 2476) and calling 
place of it(line 2309). after I commented line 2476 and test it again with the 
command "java -jar derbynet.jar abc" then it print error message once only.

I attach patch file with this.

> NetworkServerControl prints usage message twice on some errors
> --
>
> Key: DERBY-5261
> URL: https://issues.apache.org/jira/browse/DERBY-5261
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.1.2
>Reporter: Knut Anders Hatlen
>Assignee: INDIKA KUMARA
>Priority: Minor
>  Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message 
> will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an 
> option. For example "java -jar derbynet start -p" (no port number).



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


DERBY-6512 Cannot use java.util.Arrays.toString( byte[] b ) as a function.

2017-07-13 Thread Dinuka Nadeeshan
I would like to contribute to this issue. Please assign me to this issue.

[DERBY-6512]

-- 
*K. A. Dinuka Nadeeshan*
Undergraduate of Dept. of Computer Engineering, Faculty of Engineering,
University of Peradeniya, Sri-Lanka
LinkedIn:* https://www.linkedin.com/in/dinuka-nadeeshan/
*
GitHub: *https://github.com/dinukanadeeshan
*


[jira] [Commented] (DERBY-5261) NetworkServerControl prints usage message twice on some errors

2017-07-13 Thread Bryan Pendleton (JIRA)

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

Bryan Pendleton commented on DERBY-5261:


Thank you for the patch contribution!

It would be nice to have a regression test to go with this change.

Do you think it would be possible to add a regression test to the test suite 
NetworkServerControlClentCommandTest.java
in the package 
java\testing\org\apache\derbyTesting\functionTests\tests\derbynet ?

An alternate idea would be to add a new test suite in the package 
java\testing\org\apache\derbyTesting\functionTests\tests\tools, modeled after 
the test suite derbyrunjartest.java ?

Which one of these seems like it would be a better location for a regression 
test?

Do you think you could contribute a regression test?



> NetworkServerControl prints usage message twice on some errors
> --
>
> Key: DERBY-5261
> URL: https://issues.apache.org/jira/browse/DERBY-5261
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.1.2
>Reporter: Knut Anders Hatlen
>Assignee: INDIKA KUMARA
>Priority: Minor
>  Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message 
> will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl  
> Commands:
> start [-h ] [-p ] [-noSecurityManager] [-ssl ]
> shutdown [-h ][-p ] [-ssl ] [-user ] 
> [-password ]
> ping [-h ][-p ] [-ssl ]
> sysinfo [-h ][-p ] [-ssl ]
> runtimeinfo [-h ][-p ] [-ssl ]
> logconnections {on|off} [-h ][-p ] [-ssl ]
> maxthreads [-h ][-p ] [-ssl ]
> timeslice [-h ][-p ] [-ssl ]
> trace {on|off} [-s ][-h ][-p ] [-ssl ]
> tracedirectory [-h ][-p ] [-ssl ]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an 
> option. For example "java -jar derbynet start -p" (no port number).



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


Re: DERBY-6512 Cannot use java.util.Arrays.toString( byte[] b ) as a function.

2017-07-13 Thread Rick Hillegas

On 7/13/17 12:14 PM, Dinuka Nadeeshan wrote:

I would like to contribute to this issue. Please assign me to this issue.

[DERBY-6512]

--
*/K. A. Dinuka Nadeeshan/*
Undergraduate of Dept. of Computer Engineering, Faculty of 
Engineering, University of Peradeniya, Sri-Lanka

LinkedIn:/https://www.linkedin.com/in/dinuka-nadeeshan//
GitHub: /https://github.com/dinukanadeeshan/


Hi Dinuka,

What is your JIRA user id? We need that id in order to assign the issue 
to you. If you haven't already signed up for a JIRA id, please do so at 
https://issues.apache.org/jira/login.jsp


Thanks,

-Rick



[jira] [Created] (DERBY-6950) ClientConnection may be buggy

2017-07-13 Thread Hao Zhong (JIRA)
Hao Zhong created DERBY-6950:


 Summary: ClientConnection may be buggy
 Key: DERBY-6950
 URL: https://issues.apache.org/jira/browse/DERBY-6950
 Project: Derby
  Issue Type: Bug
Reporter: Hao Zhong


DERBY-210 fixed some leaked statements in Connection.java. I notice that 
ClientConnection. java is similar to the buggy version of Connection.java. For 
example, both files have the following methods:

{code}
  synchronized PreparedStatement prepareDynamicCatalogQuery(String sql) throws 
SqlException {
PreparedStatement ps = newPreparedStatement_(sql, 
java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY, 
resultSetHoldability_, java.sql.Statement.NO_GENERATED_KEYS, null);
ps.isCatalogQuery_ = true;
ps.prepare();
openStatements_.put(ps,null);
return ps;
}
{code}

The fixed version of Connection.java is as follow:
{code}
synchronized PreparedStatement prepareDynamicCatalogQuery(String sql) throws 
SqlException {
PreparedStatement ps = newPreparedStatement_(sql, 
java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY, 
resultSetHoldability_, java.sql.Statement.NO_GENERATED_KEYS, null);
ps.isCatalogQuery_ = true;
ps.prepare();
openStatements_.add(ps);
return ps;
}
{code}

It is worthy exploring whehter ClientConnection. java has similar problems. If 
it is, it can be fixed as how DERBY-210 was fixed. 



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


[jira] [Created] (DERBY-6951) ClientPreparedStatement may be buggy

2017-07-13 Thread Hao Zhong (JIRA)
Hao Zhong created DERBY-6951:


 Summary: ClientPreparedStatement may be buggy
 Key: DERBY-6951
 URL: https://issues.apache.org/jira/browse/DERBY-6951
 Project: Derby
  Issue Type: Bug
  Components: SQL
Reporter: Hao Zhong


DERBY-1610 fixed some bugs in PreparedStatement.java. I find that the buggy 
file is similar to ClientPreparedStatement.java. For example, both files have 
the following code:
{code}
public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws 
SQLException {
try
{
synchronized (connection_) {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "setBigDecimal", 
parameterIndex, x);
}

final int paramType = 
getColumnMetaDataX().getColumnType(parameterIndex);

  ...
}
catch ( SqlException se )
{
throw se.getSQLException();
}
}
{code}
The fixed code is as follow:
{code}
public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws 
SQLException {
try
{
synchronized (connection_) {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "setBigDecimal", 
parameterIndex, x);
}

final int paramType = 
getColumnMetaDataX().getColumnType( 
checkForEscapedCallWithResult( parameterIndex ) );

...
}
catch ( SqlException se )
{
throw se.getSQLException();
}
}
{code}

The repair can be applied to ClientPreparedStatement.java



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