List:Commits« Previous MessageNext Message »
From:mmatthews Date:February 17 2006 10:24pm
Subject:Connector/J commit: r4948 - in branches/branch_5_1/connector-j: . src/testsuite/regression
View as plain text  
Modified:
   branches/branch_5_1/connector-j/CHANGES
   branches/branch_5_1/connector-j/src/testsuite/regression/StatementRegressionTest.java
Log:
Merge of regression testcase of BUG#17099 from 5.0 branch.

Modified: branches/branch_5_1/connector-j/CHANGES
===================================================================
--- branches/branch_5_1/connector-j/CHANGES	2006-02-17 18:53:35 UTC (rev 4947)
+++ branches/branch_5_1/connector-j/CHANGES	2006-02-17 22:24:28 UTC (rev 4948)
@@ -139,6 +139,9 @@
       driver was checking for the existence of single-column primary keys and
       an autoincrement value > 0 instead of a straightforward isAutoIncrement() 
       check).
+          
+    - Fixed BUG#17099 - Statement.getGeneratedKeys() throws NullPointerException 
+      when no query has been processed.
       
     - Fixed BUG#13469 - Driver tries to call methods that don't exist on older and
       newer versions of Log4j. The fix is not trying to auto-detect presense of log4j, 

Modified: branches/branch_5_1/connector-j/src/testsuite/regression/StatementRegressionTest.java
===================================================================
--- branches/branch_5_1/connector-j/src/testsuite/regression/StatementRegressionTest.java	2006-02-17 18:53:35 UTC (rev 4947)
+++ branches/branch_5_1/connector-j/src/testsuite/regression/StatementRegressionTest.java	2006-02-17 22:24:28 UTC (rev 4948)
@@ -3019,4 +3019,23 @@
 		}
 	}
 
+	/**
+	 * Tests fix for BUG#17099 - Statement.getGeneratedKeys()
+	 * throws NPE when no query has been processed.
+	 * 
+	 * @throws Exception if the test fails
+	 */
+	public void testBug17099() throws Exception {
+		Statement newStmt = this.conn.createStatement();
+		assertNotNull(newStmt.getGeneratedKeys());
+		
+		PreparedStatement pStmt = this.conn.prepareStatement("SELECT 1");
+		assertNotNull(pStmt.getGeneratedKeys());
+		
+		if (versionMeetsMinimum(4, 1)) {
+			pStmt = ((com.mysql.jdbc.Connection)this.conn).clientPrepareStatement("SELECT 1");
+			assertNotNull(pStmt.getGeneratedKeys());
+		}
+	}
+
 }

Thread
Connector/J commit: r4948 - in branches/branch_5_1/connector-j: . src/testsuite/regressionmmatthews17 Feb