Bug #21480 | Incorrect exception thrown when using timeout | ||
---|---|---|---|
Submitted: | 7 Aug 2006 12:49 | Modified: | 22 Feb 2007 11:23 |
Reporter: | Erik Ekman | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | All | OS: | Any (All) |
Assigned to: | Mark Matthews | CPU Architecture: | Any |
[7 Aug 2006 12:49]
Erik Ekman
[7 Aug 2006 12:49]
Erik Ekman
Test application
Attachment: MysqlTest.java (application/octet-stream, text), 888 bytes.
[7 Aug 2006 12:50]
Erik Ekman
Suggested patch
Attachment: timeoutexception.patch (application/octet-stream, text), 804 bytes.
[8 Aug 2006 11:44]
Erik Ekman
A similar fix should probably be applied to the case when not using timeout (around line 156) to avoid wrapping the exception in a SocketException. And SocketTimeoutException should be added at line 203 to avoid wrapping the SocketTimeoutException. Should I send a new patch?
[8 Aug 2006 14:13]
Tonci Grgin
Erik, feel free to post your fix. Thanks for your interest in MySQL. Regards Tonci
[9 Aug 2006 7:50]
Erik Ekman
New patch
Attachment: unwrap_exceptions.patch (application/octet-stream, text), 1.56 KiB.
[9 Aug 2006 14:19]
Tonci Grgin
Verified as described by reporter with test case provided. I used mysql-connector-java-3.1.13 and mysql-connector-java-5.0-nightly-20060704.
[10 Jan 2007 21:59]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/17893
[10 Jan 2007 22:12]
Mark Matthews
I fixed this a little bit differently than proposed by your patch to avoid copy-and-paste of code (centralized into one method), and to avoid newer JVM methods when unwrapping exceptions, since we still have users who can't move off of JDK-1.2 and 1.3.
[22 Feb 2007 11:23]
MC Brown
A note has been added to the 5.0.5 changelog.