List:Commits« Previous MessageNext Message »
From:mark.matthews Date:April 19 2011 10:07pm
Subject:bzr push into connector-j/branches/branch_5_1 branch (mark.matthews:1059 to
1060)
View as plain text  
 1060 mark.matthews@stripped	2011-04-19
      Store a copy of the properties, in case it's mutated later.

    modified:
      src/com/mysql/jdbc/StatementImpl.java
 1059 mark.matthews@stripped	2011-04-15
      Fixing compilation error.

    modified:
      src/testsuite/regression/jdbc4/ConnectionRegressionTest.java
=== modified file 'src/com/mysql/jdbc/StatementImpl.java'
--- a/src/com/mysql/jdbc/StatementImpl.java	2011-04-15 15:27:45 +0000
+++ b/src/com/mysql/jdbc/StatementImpl.java	2011-04-19 22:07:30 +0000
@@ -31,6 +31,7 @@ import java.sql.SQLWarning;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Enumeration;
 import java.util.GregorianCalendar;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -76,14 +77,24 @@ public class StatementImpl implements St
 		String origHost = "";
 		SQLException caughtWhileCancelling = null;
 		StatementImpl toCancel;
-		Properties origConProps = null; 
+		Properties origConnProps = null; 
 		String origConnURL = "";
 		
 		CancelTask(StatementImpl cancellee) throws SQLException {
 			connectionId = cancellee.connectionId;
 			origHost = connection.getHost();
 			toCancel = cancellee;
-			origConProps = connection.getProperties();
+			origConnProps = new Properties();
+			
+			Properties props = connection.getProperties();
+			
+			Enumeration<?> keys = props.propertyNames();
+			
+			while (keys.hasMoreElements()) {
+				String key = keys.nextElement().toString();
+				origConnProps.setProperty(key, props.getProperty(key));
+			}
+			
 			origConnURL = connection.getURL();
 		}
 
@@ -116,7 +127,7 @@ public class StatementImpl implements St
 									cancelStmt.execute("KILL QUERY " + connectionId);
 								} else {
 									try {
-										cancelConn = (Connection) DriverManager.getConnection(origConnURL, origConProps);
+										cancelConn = (Connection) DriverManager.getConnection(origConnURL, origConnProps);
 										cancelStmt = cancelConn.createStatement();
 										cancelStmt.execute("KILL QUERY " + connectionId);
 									} catch (NullPointerException npe){
@@ -153,7 +164,7 @@ public class StatementImpl implements St
 							}
 							
 							toCancel = null;
-							origConProps = null;
+							origConnProps = null;
 							origConnURL = null;
 						}
 					}


Attachment: [text/bzr-bundle] bzr/mark.matthews@oracle.com-20110419220730-r81qxyv3rbj815jo.bundle
Thread
bzr push into connector-j/branches/branch_5_1 branch (mark.matthews:1059 to1060) mark.matthews20 Apr