db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4799) IllegalArgumentException when generating error message on server
Date Tue, 14 Sep 2010 08:14:33 GMT

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

Knut Anders Hatlen commented on DERBY-4799:
-------------------------------------------

Thanks, I've linked it to DERBY-728.

Will your changes in 10.7 make the error handling stop using writeRDBNAM()? This is not code
that uses EBCDIC in the first place, so I was under the impression that it wouldn't be touched
by the DERBY-4757 changes.

For the record, the connect command in the bug description is supposed to fail, because the
database isn't found. Here's what happens with the fix applied:

ij> connect 'jdbc:derby://localhost/abcdefghijklmnopqå';
ERROR 08004: The connection was refused because the database abcdefghijklmnopqå was not found.

This appears to only be a problem in the case where we expect a failure. If I add create=true
to the URL so that the database is created, it works fine also without the fix.

> IllegalArgumentException when generating error message on server
> ----------------------------------------------------------------
>
>                 Key: DERBY-4799
>                 URL: https://issues.apache.org/jira/browse/DERBY-4799
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.6.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: fix.diff
>
>
> If you for example try to connect to a non-existing database using the client driver,
and the name of the database has 18 characters or more, and at least one of the characters
in the database name is a non-ascii character, the server will throw an IllegalArgumentException
when trying to send the "database not found" message back to the client.
> Example:
> ij> connect 'jdbc:derby://localhost/abcdefghijklmnopqå';
> ERROR 08006: A network protocol error was encountered and the connection has been terminated:
A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x12. Plaintext connection attempt
to an SSL enabled server?
> Printed to the console by the server:
> Tue Sep 14 09:12:05 CEST 2010 : fromIndex(60) > toIndex(59)
> java.lang.IllegalArgumentException: fromIndex(60) > toIndex(59)
> 	at java.util.Arrays.rangeCheck(Arrays.java:1306)
> 	at java.util.Arrays.fill(Arrays.java:2567)
> 	at org.apache.derby.impl.drda.DDMWriter.padBytes(DDMWriter.java:1254)
> 	at org.apache.derby.impl.drda.DDMWriter.writeScalarPaddedBytes(DDMWriter.java:992)
> 	at org.apache.derby.impl.drda.DRDAConnThread.writeRDBNAM(DRDAConnThread.java:583)
> 	at org.apache.derby.impl.drda.DRDAConnThread.writeRDBfailure(DRDAConnThread.java:1248)
> 	at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(DRDAConnThread.java:1194)
> 	at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:968)
> 	at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:294)

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


Mime
View raw message