From: Date: August 30 2007 11:49pm Subject: Connector/J commit: r6539 - in branches/branch_5_1: . connector-j connector-j/src/com/mysql/jdbc connector-j/src/testsuite/regression List-Archive: http://lists.mysql.com/commits/33481 X-Bug: 29852 Message-Id: <200708302149.l7ULnuP8024398@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/branch_5_1/ branches/branch_5_1/connector-j/CHANGES branches/branch_5_1/connector-j/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java branches/branch_5_1/connector-j/src/testsuite/regression/ConnectionRegressionTest.java Log: Merged revisions 6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6522,6524,6526-6528,6530-6531,6533-6534,6536-6538 via svnmerge from svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/trunk ............... r6538 | mmatthews | 2007-08-30 16:39:03 -0500 (Thu, 30 Aug 2007) | 13 lines Merged revisions 6535-6537 via svnmerge from svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_0 ........ r6537 | mmatthews | 2007-08-30 16:26:34 -0500 (Thu, 30 Aug 2007) | 3 lines Fixed BUG#29852 - Closing a load-balanced connection would cause a ClassCastException. ........ ............... Property changes on: branches/branch_5_1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk:1-6396,6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6535 + /trunk:1-6396,6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6538 Modified: branches/branch_5_1/connector-j/CHANGES =================================================================== --- branches/branch_5_1/connector-j/CHANGES 2007-08-30 21:39:03 UTC (rev 6538) +++ branches/branch_5_1/connector-j/CHANGES 2007-08-30 21:49:56 UTC (rev 6539) @@ -199,16 +199,19 @@ - Fixed BUG#29106 - Connection checker for JBoss didn't use same method parameters via reflection, causing connections to always seem "bad". - - Fixed BUG#30664. Note that this fix only works for MySQL server + - Fixed BUG#30664 - Note that this fix only works for MySQL server versions 5.0.25 and newer, since earlier versions didn't consistently return correct metadata for functions, and thus results from subqueries and functions were indistinguishable from each other, leading to type-related bugs. - - Fixed BUG#28972, DatabaseMetaData.getTypeInfo() for the types DECIMAL + - Fixed BUG#28972 - DatabaseMetaData.getTypeInfo() for the types DECIMAL and NUMERIC will return a precision of 254 for server versions older than 5.0.3, 64 for versions 5.0.3-5.0.5 and 65 for versions newer than 5.0.5. - + + - Fixed BUG#29852 - Closing a load-balanced connection would cause a + ClassCastException. + 07-19-07 - Version 5.0.7 - Setting the configuration parameter "useCursorFetch" to "true" for Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java =================================================================== --- branches/branch_5_1/connector-j/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java 2007-08-30 21:39:03 UTC (rev 6538) +++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/LoadBalancingConnectionProxy.java 2007-08-30 21:49:56 UTC (rev 6539) @@ -318,7 +318,7 @@ if ("close".equals(methodName)) { synchronized (this.liveConnections) { // close all underlying connections - Iterator allConnections = this.liveConnections.entrySet() + Iterator allConnections = this.liveConnections.values() .iterator(); while (allConnections.hasNext()) { Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java =================================================================== --- branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java 2007-08-30 21:39:03 UTC (rev 6538) +++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/NonRegisteringDriver.java 2007-08-30 21:49:56 UTC (rev 6539) @@ -321,7 +321,7 @@ LoadBalancingConnectionProxy proxyBal = new LoadBalancingConnectionProxy( hostList, parsedProps); - return (Connection) java.lang.reflect.Proxy.newProxyInstance(this + return (java.sql.Connection) java.lang.reflect.Proxy.newProxyInstance(this .getClass().getClassLoader(), new Class[] { java.sql.Connection.class }, proxyBal); } Modified: branches/branch_5_1/connector-j/src/testsuite/regression/ConnectionRegressionTest.java =================================================================== --- branches/branch_5_1/connector-j/src/testsuite/regression/ConnectionRegressionTest.java 2007-08-30 21:39:03 UTC (rev 6538) +++ branches/branch_5_1/connector-j/src/testsuite/regression/ConnectionRegressionTest.java 2007-08-30 21:49:56 UTC (rev 6539) @@ -2159,4 +2159,21 @@ } } } -} \ No newline at end of file + + public void testBug29852() throws Exception { + int indexOfHostStart = dbUrl.indexOf("://") + 3; + int indexOfHostEnd = dbUrl.indexOf("/", indexOfHostStart); + + String backHalf = dbUrl.substring(indexOfHostStart, indexOfHostEnd); + + if (backHalf.length() == 0) { + backHalf = "localhost:3306"; + } + + String dbAndConfigs = dbUrl.substring(indexOfHostEnd); + + Connection lbConn = DriverManager.getConnection("jdbc:mysql:loadbalance://" + backHalf + "," + backHalf + dbAndConfigs); + assertTrue(!lbConn.getClass().getName().startsWith("com.mysql.jdbc")); + lbConn.close(); + } +}