List:Commits« Previous MessageNext Message »
From:mmatthews Date:January 8 2008 6:44am
Subject:Connector/J commit: r6709 - in trunk: . src/com/mysql/jdbc src/testsuite/regression
View as plain text  
Modified:
   trunk/
   trunk/CHANGES
   trunk/src/com/mysql/jdbc/ConnectionImpl.java
   trunk/src/testsuite/regression/ConnectionRegressionTest.java
Log:
Merged revisions
6585-6586,6593-6597,6599-6602,6605,6607-6609,6612,6614-6617,6619-6620,6623-6627,6632,6636-6638,6641,6649,6658-6659,6663,6665-6673,6676,6681-6682,6684,6686,6688,6690-6691,6693,6698,6707-6708
via svnmerge from 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_1

.......
  r6708 | mmatthews | 2008-01-07 23:37:51 -0600 (Mon, 07 Jan 2008) | 3 lines
  
  Fixed BUG#33734 - NullPointerException when using client-side
  
         prepared statements and enabling caching of prepared statements (only
  
         present in nightly builds of 5.1).
.......



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/branch_5_0:1-6636,6638-6670 /branches/branch_5_1:1-6582,6584-6678,6680-6706
   + /branches/branch_5_0:1-6636,6638-6670 /branches/branch_5_1:1-6582,6584-6678,6680-6708

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2008-01-08 05:37:51 UTC (rev 6708)
+++ trunk/CHANGES	2008-01-08 05:44:40 UTC (rev 6709)
@@ -130,6 +130,10 @@
        procedures, with the exception of stored procedures with registered 
        OUTPUT parameters, which can't be used at all with "streaming" result 
        sets.
+
+    -  Fixed BUG#33734 - NullPointerException when using client-side
+       prepared statements and enabling caching of prepared statements (only
+       present in nightly builds of 5.1).
        
 10-09-07 - Version 5.1.5
 

Modified: trunk/src/com/mysql/jdbc/ConnectionImpl.java
===================================================================
--- trunk/src/com/mysql/jdbc/ConnectionImpl.java	2008-01-08 05:37:51 UTC (rev 6708)
+++ trunk/src/com/mysql/jdbc/ConnectionImpl.java	2008-01-08 05:44:40 UTC (rev 6709)
@@ -908,6 +908,10 @@
 			return true;
 		}
 
+		if (!this.useServerPreparedStmts) {
+			return false;
+		}
+		
 		if (getCachePreparedStatements()) {
 			synchronized (this.serverSideStatementCheckCache) {
 				Boolean flag = (Boolean)this.serverSideStatementCheckCache.get(sql);
@@ -4085,7 +4089,7 @@
 		
 		String nativeSql = getProcessEscapeCodesForPrepStmts() ? nativeSQL(sql): sql;
 		
-		if (getEmulateUnsupportedPstmts()) {
+		if (this.useServerPreparedStmts && getEmulateUnsupportedPstmts()) {
 			canServerPrepare = canHandleAsServerPreparedStatement(nativeSql);
 		}
 		

Modified: trunk/src/testsuite/regression/ConnectionRegressionTest.java
===================================================================
--- trunk/src/testsuite/regression/ConnectionRegressionTest.java	2008-01-08 05:37:51 UTC
(rev 6708)
+++ trunk/src/testsuite/regression/ConnectionRegressionTest.java	2008-01-08 05:44:40 UTC
(rev 6709)
@@ -2318,4 +2318,20 @@
 		
 		assertTrue(System.currentTimeMillis() - begin < 10000);
 	}
-}
+	
+	/**
+	 * Tests fix for BUG#33734 - NullPointerException when using client-side
+	 * prepared statements and enabling caching of prepared statements (only present
+	 * in nightly builds of 5.1).
+	 * 
+	 * @throws Exception
+	 */
+	public void testBug33734() throws Exception {
+		Connection testConn =
getConnectionWithProps("cachePrepStmts=true,useServerPrepStmts=false");
+		try {
+			testConn.prepareStatement("SELECT 1");
+		} finally {
+			testConn.close();
+		}
+	}
+}
\ No newline at end of file

Thread
Connector/J commit: r6709 - in trunk: . src/com/mysql/jdbc src/testsuite/regressionmmatthews8 Jan