List:Commits« Previous MessageNext Message »
From:mmatthews Date:January 31 2008 6:10am
Subject:Connector/J commit: r6718 - in trunk: . src/com/mysql/jdbc src/testsuite src/testsuite/regression
View as plain text  
Modified:
   trunk/
   trunk/CHANGES
   trunk/src/com/mysql/jdbc/CachedResultSetMetaData.java
   trunk/src/com/mysql/jdbc/StatementImpl.java
   trunk/src/testsuite/BaseTestCase.java
   trunk/src/testsuite/regression/CallableStatementRegressionTest.java
   trunk/src/testsuite/regression/ResultSetRegressionTest.java
   trunk/src/testsuite/regression/StatementRegressionTest.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,6709-6717
via svnmerge from 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_1

.......
  r6714 | mmatthews | 2008-01-19 21:53:35 -0600 (Sat, 19 Jan 2008) | 2 lines
  
  Fixed BUG#33823 - Public interface ResultSetInternalMethods with reference to 
        non-public class com.mysql.jdbc.CachedResultSetMetaData.
.......
  r6715 | mmatthews | 2008-01-19 21:53:53 -0600 (Sat, 19 Jan 2008) | 1 line
  
  Merged.
.......
  r6716 | mmatthews | 2008-01-30 22:01:20 -0600 (Wed, 30 Jan 2008) | 1 line
  
  Added tests from the JDBC E.G.
.......
  r6717 | mmatthews | 2008-01-30 22:59:17 -0600 (Wed, 30 Jan 2008) | 3 lines
  
  Fixed BUG#30493 - Statements with batched values do not return correct values for 
  
        getGeneratedKeys() when "rewriteBatchedStatements" is set to "true", and the 
  
        statement has an "ON DUPLICATE KEY UPDATE" clause.
.......



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

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2008-01-31 04:59:17 UTC (rev 6717)
+++ trunk/CHANGES	2008-01-31 05:10:51 UTC (rev 6718)
@@ -108,33 +108,17 @@
       conditions where one thread that has created a connection "shares" it with other
       threads if the connection is reconnected due to auto-reconnect functionality.
       
+    - Fixed BUG#33823 - Public interface ResultSetInternalMethods with reference to 
+      non-public class com.mysql.jdbc.CachedResultSetMetaData.
+      
     - For any SQLException caused by another Throwable, besides dumping the message or
stack
       trace as a string into the message, set the underlying Throwable as the cause for
-      the SQLException, making it accessible via getCause().
-      
-    - Fixed Bug#33594 - When cursor fetch is enabled, wrong metadata is returned from 
-      DatabaseMetaData calls. 
+      the SQLException, making it accessible via getCause().  
+     
+    - Fixed BUG#30493 - Statements with batched values do not return correct values for 
+      getGeneratedKeys() when "rewriteBatchedStatements" is set to "true", and the 
+      statement has an "ON DUPLICATE KEY UPDATE" clause.
 
-      The fix is two parts. 
-      
-      First, when asking for the first column value
-      twice from a cursor-fetched row, the driver didn't re-position,
-      and thus the "next" column was returned.
-
-      Second, metadata statements and internal statements the driver
-      uses shouldn't use cursor-based fetching at all, so we've
-      ensured that internal statements have their fetch size set to "0".
-
-    -  Fixed Bug#33678 - Multiple result sets not supported in
-       "streaming" mode. This fix covers both normal statements, and stored
-       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
 
     - Released instead of 5.1.4 to pickup patch for BUG#31053

Modified: trunk/src/com/mysql/jdbc/CachedResultSetMetaData.java
===================================================================
--- trunk/src/com/mysql/jdbc/CachedResultSetMetaData.java	2008-01-31 04:59:17 UTC (rev
6717)
+++ trunk/src/com/mysql/jdbc/CachedResultSetMetaData.java	2008-01-31 05:10:51 UTC (rev
6718)
@@ -23,9 +23,10 @@
 
 package com.mysql.jdbc;
 
+import java.sql.ResultSetMetaData;
 import java.util.Map;
 
-class CachedResultSetMetaData {
+public class CachedResultSetMetaData {
 		/** Map column names (and all of their permutations) to column indices */
 		Map columnNameToIndex = null;
 
@@ -37,4 +38,20 @@
 
 		/** Cached ResultSetMetaData */
 		java.sql.ResultSetMetaData metadata;
+
+		public Map getColumnNameToIndex() {
+			return columnNameToIndex;
+		}
+
+		public Field[] getFields() {
+			return fields;
+		}
+
+		public Map getFullColumnNameToIndex() {
+			return fullColumnNameToIndex;
+		}
+
+		public java.sql.ResultSetMetaData getMetadata() {
+			return metadata;
+		}
 	}
\ No newline at end of file

Modified: trunk/src/com/mysql/jdbc/StatementImpl.java
===================================================================
--- trunk/src/com/mysql/jdbc/StatementImpl.java	2008-01-31 04:59:17 UTC (rev 6717)
+++ trunk/src/com/mysql/jdbc/StatementImpl.java	2008-01-31 05:10:51 UTC (rev 6718)
@@ -1181,15 +1181,14 @@
 		updateCounts[updateCountCounter++] = batchedStatement.getUpdateCount();
 		
 		boolean doGenKeys = this.batchedGeneratedKeys != null;
-		
-		long generatedKeyStart = 0;
+
 		byte[][] row = null;
 		
 		if (doGenKeys) {
-			generatedKeyStart = batchedStatement.getLastInsertID();
+			long generatedKey = batchedStatement.getLastInsertID();
 		
 			row = new byte[1][];
-			row[0] = Long.toString(generatedKeyStart++).getBytes();
+			row[0] = Long.toString(generatedKey).getBytes();
 			this.batchedGeneratedKeys.add(new ByteArrayRow(row));
 		}
 
@@ -1198,8 +1197,10 @@
 			updateCounts[updateCountCounter++] = batchedStatement.getUpdateCount();
 			
 			if (doGenKeys) {
+				long generatedKey = batchedStatement.getLastInsertID();
+				
 				row = new byte[1][];
-				row[0] = Long.toString(generatedKeyStart++).getBytes();
+				row[0] = Long.toString(generatedKey).getBytes();
 				this.batchedGeneratedKeys.add(new ByteArrayRow(row));
 			}
 		}

Modified: trunk/src/testsuite/BaseTestCase.java
===================================================================
--- trunk/src/testsuite/BaseTestCase.java	2008-01-31 04:59:17 UTC (rev 6717)
+++ trunk/src/testsuite/BaseTestCase.java	2008-01-31 05:10:51 UTC (rev 6718)
@@ -664,4 +664,38 @@
 			}
 		}
 	}
+
+	protected void assertResultSetsEqual(ResultSet control, ResultSet test)
+			throws Exception {
+				int controlNumCols = control.getMetaData().getColumnCount();
+				int testNumCols = test.getMetaData().getColumnCount();
+				assertEquals(controlNumCols, testNumCols);
+				
+				while (control.next()) {
+					test.next();
+					
+					for (int i = 0; i < controlNumCols; i++) {
+						Object controlObj = control.getObject(i + 1);
+						Object testObj = test.getObject(i + 1);
+						
+						if (controlObj == null) {
+							assertNull(testObj);
+						} else {
+							assertNotNull(testObj);
+						}
+						
+						if (controlObj instanceof Float) {
+							assertEquals(((Float)controlObj).floatValue(),
+									((Float)testObj).floatValue(), 0.1);
+						} else if (controlObj instanceof Double) {
+							assertEquals(((Double)controlObj).doubleValue(),
+									((Double)testObj).doubleValue(), 0.1);
+						} else {
+							assertEquals(controlObj, testObj);
+						}
+					}
+				}
+					
+				assertFalse(test.next());
+			}
 }
\ No newline at end of file

Modified: trunk/src/testsuite/regression/CallableStatementRegressionTest.java
===================================================================
--- trunk/src/testsuite/regression/CallableStatementRegressionTest.java	2008-01-31
04:59:17 UTC (rev 6717)
+++ trunk/src/testsuite/regression/CallableStatementRegressionTest.java	2008-01-31
05:10:51 UTC (rev 6718)
@@ -88,7 +88,7 @@
 					+ "BEGIN\n" + "SELECT 1;" + "end\n");
 
 			this.rs = this.conn.getMetaData().getProcedures(null, null,
-			"testBug3539");
+					"testBug3539");
 
 			assertTrue(this.rs.next());
 			assertTrue("testBug3539".equals(this.rs.getString(3)));
@@ -111,11 +111,11 @@
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug3540");
 			this.stmt
-			.executeUpdate("CREATE PROCEDURE testBug3540(x int, out y int)\n"
-					+ "BEGIN\n" + "SELECT 1;" + "end\n");
+					.executeUpdate("CREATE PROCEDURE testBug3540(x int, out y int)\n"
+							+ "BEGIN\n" + "SELECT 1;" + "end\n");
 
-			this.rs = this.conn.getMetaData().getProcedureColumns(null,
-					null, "testBug3540%", "%");
+			this.rs = this.conn.getMetaData().getProcedureColumns(null, null,
+					"testBug3540%", "%");
 
 			assertTrue(this.rs.next());
 			assertTrue("testBug3540".equals(this.rs.getString(3)));
@@ -146,8 +146,8 @@
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug7026");
 			this.stmt
-			.executeUpdate("CREATE PROCEDURE testBug7026(x int, out y int)\n"
-					+ "BEGIN\n" + "SELECT 1;" + "end\n");
+					.executeUpdate("CREATE PROCEDURE testBug7026(x int, out y int)\n"
+							+ "BEGIN\n" + "SELECT 1;" + "end\n");
 
 			//
 			// Should be found this time.
@@ -164,8 +164,8 @@
 			// This time, shouldn't be found, because not associated with
 			// this (bogus) catalog
 			//
-			this.rs = this.conn.getMetaData().getProcedures("abfgerfg",
-					null, "testBug7026");
+			this.rs = this.conn.getMetaData().getProcedures("abfgerfg", null,
+					"testBug7026");
 			assertTrue(!this.rs.next());
 
 			//
@@ -173,7 +173,7 @@
 			// specified a catalog.
 			//
 			this.rs = this.conn.getMetaData().getProcedures(null, null,
-			"testBug7026");
+					"testBug7026");
 
 			assertTrue(this.rs.next());
 			assertTrue("testBug7026".equals(this.rs.getString(3)));
@@ -201,7 +201,6 @@
 		// hang on the
 		// last execution of this testcase, filed as BUG#9405
 
-
 		if (isAdminConnectionConfigured()) {
 			Connection db2Connection = null;
 			Connection db1Connection = null;
@@ -215,44 +214,40 @@
 				db2Connection.setCatalog("db_9319_2");
 
 				db2Connection.createStatement().executeUpdate(
-				"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
+						"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
 
-				db2Connection
-				.createStatement()
-				.executeUpdate(
+				db2Connection.createStatement().executeUpdate(
 						"CREATE PROCEDURE COMPROVAR_USUARI(IN p_CodiUsuari VARCHAR(10),"
-						+ "\nIN p_contrasenya VARCHAR(10),"
-						+ "\nOUT p_userId INTEGER,"
-						+ "\nOUT p_userName VARCHAR(30),"
-						+ "\nOUT p_administrador VARCHAR(1),"
-						+ "\nOUT p_idioma VARCHAR(2))"
-						+ "\nBEGIN"
+								+ "\nIN p_contrasenya VARCHAR(10),"
+								+ "\nOUT p_userId INTEGER,"
+								+ "\nOUT p_userName VARCHAR(30),"
+								+ "\nOUT p_administrador VARCHAR(1),"
+								+ "\nOUT p_idioma VARCHAR(2))"
+								+ "\nBEGIN"
 
-						+ (doASelect ? "\nselect 2;"
-								: "\nSELECT 2 INTO p_administrador;")
+								+ (doASelect ? "\nselect 2;"
+										: "\nSELECT 2 INTO p_administrador;")
 								+ "\nEND");
 
 				db1Connection.createStatement().executeUpdate(
-				"CREATE DATABASE IF NOT EXISTS db_9319_1");
+						"CREATE DATABASE IF NOT EXISTS db_9319_1");
 				db1Connection.setCatalog("db_9319_1");
 
 				db1Connection.createStatement().executeUpdate(
-				"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
-				db1Connection
-				.createStatement()
-				.executeUpdate(
+						"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
+				db1Connection.createStatement().executeUpdate(
 						"CREATE PROCEDURE COMPROVAR_USUARI(IN p_CodiUsuari VARCHAR(10),"
-						+ "\nIN p_contrasenya VARCHAR(10),"
-						+ "\nOUT p_userId INTEGER,"
-						+ "\nOUT p_userName VARCHAR(30),"
-						+ "\nOUT p_administrador VARCHAR(1))"
-						+ "\nBEGIN"
-						+ (doASelect ? "\nselect 1;"
-								: "\nSELECT 1 INTO p_administrador;")
+								+ "\nIN p_contrasenya VARCHAR(10),"
+								+ "\nOUT p_userId INTEGER,"
+								+ "\nOUT p_userName VARCHAR(30),"
+								+ "\nOUT p_administrador VARCHAR(1))"
+								+ "\nBEGIN"
+								+ (doASelect ? "\nselect 1;"
+										: "\nSELECT 1 INTO p_administrador;")
 								+ "\nEND");
 
 				CallableStatement cstmt = db2Connection
-				.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?, ?) }");
+						.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?, ?) }");
 				cstmt.setString(1, "abc");
 				cstmt.setString(2, "def");
 				cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
@@ -272,7 +267,7 @@
 				}
 
 				cstmt = db1Connection
-				.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?, ?) }");
+						.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?, ?) }");
 				cstmt.setString(1, "abc");
 				cstmt.setString(2, "def");
 				cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
@@ -288,7 +283,7 @@
 				}
 
 				cstmt = db1Connection
-				.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?) }");
+						.prepareCall("{ call COMPROVAR_USUARI(?, ?, ?, ?, ?) }");
 				cstmt.setString(1, "abc");
 				cstmt.setString(2, "def");
 				cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
@@ -306,7 +301,7 @@
 				}
 
 				String quoteChar = db2Connection.getMetaData()
-				.getIdentifierQuoteString();
+						.getIdentifierQuoteString();
 
 				cstmt = db2Connection.prepareCall("{ call " + quoteChar
 						+ db1Connection.getCatalog() + quoteChar + "."
@@ -332,14 +327,14 @@
 					db2Connection.createStatement().executeUpdate(
 							"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
 					db2Connection.createStatement().executeUpdate(
-					"DROP DATABASE IF EXISTS db_9319_2");
+							"DROP DATABASE IF EXISTS db_9319_2");
 				}
 
 				if (db1Connection != null) {
 					db1Connection.createStatement().executeUpdate(
 							"DROP PROCEDURE IF EXISTS COMPROVAR_USUARI");
 					db1Connection.createStatement().executeUpdate(
-					"DROP DATABASE IF EXISTS db_9319_1");
+							"DROP DATABASE IF EXISTS db_9319_1");
 				}
 			}
 		}
@@ -453,8 +448,8 @@
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug9682");
 			this.stmt
-			.executeUpdate("CREATE PROCEDURE testBug9682(decimalParam DECIMAL(18,0))"
-					+ "\nBEGIN" + "\n   SELECT 1;" + "\nEND");
+					.executeUpdate("CREATE PROCEDURE testBug9682(decimalParam DECIMAL(18,0))"
+							+ "\nBEGIN" + "\n   SELECT 1;" + "\nEND");
 			cStmt = this.conn.prepareCall("Call testBug9682(?)");
 			cStmt.setDouble(1, 18.0);
 			cStmt.execute();
@@ -485,8 +480,8 @@
 		try {
 			this.stmt.executeUpdate("DROP FUNCTION IF EXISTS testBug10310");
 			this.stmt
-			.executeUpdate("CREATE FUNCTION testBug10310(a float, b bigint, c int) RETURNS INT"
-					+ "\nBEGIN" + "\nRETURN a;" + "\nEND");
+					.executeUpdate("CREATE FUNCTION testBug10310(a float, b bigint, c int) RETURNS INT"
+							+ "\nBEGIN" + "\nRETURN a;" + "\nEND");
 			cStmt = this.conn.prepareCall("{? = CALL testBug10310(?,?,?)}");
 			cStmt.registerOutParameter(1, Types.INTEGER);
 			cStmt.setFloat(2, 2);
@@ -494,8 +489,10 @@
 			cStmt.setInt(4, 1);
 
 			if (!isRunningOnJdk131()) {
-				assertEquals(4, cStmt.getParameterMetaData().getParameterCount());
-				assertEquals(Types.INTEGER, cStmt.getParameterMetaData().getParameterType(1));
+				assertEquals(4, cStmt.getParameterMetaData()
+						.getParameterCount());
+				assertEquals(Types.INTEGER, cStmt.getParameterMetaData()
+						.getParameterType(1));
 			}
 
 			assertFalse(cStmt.execute());
@@ -529,10 +526,9 @@
 			java.sql.DatabaseMetaData dbmd = this.conn.getMetaData();
 
 			this.rs = dbmd.getProcedures(this.conn.getCatalog(), null,
-			"testBug10310");
+					"testBug10310");
 			this.rs.next();
-			assertEquals("testBug10310", this.rs
-					.getString("PROCEDURE_NAME"));
+			assertEquals("testBug10310", this.rs.getString("PROCEDURE_NAME"));
 			assertEquals(DatabaseMetaData.procedureReturnsResult, this.rs
 					.getShort("PROCEDURE_TYPE"));
 			cStmt.setNull(2, Types.FLOAT);
@@ -551,7 +547,6 @@
 			assertEquals(null, cStmt.getObject(1));
 			assertEquals(true, cStmt.wasNull());
 
-
 			// Check with literals, not all parameters filled!
 			cStmt = this.conn.prepareCall("{? = CALL testBug10310(4,5,?)}");
 			cStmt.registerOutParameter(1, Types.INTEGER);
@@ -568,9 +563,12 @@
 					.getName());
 
 			if (!isRunningOnJdk131()) {
-				assertEquals(2, cStmt.getParameterMetaData().getParameterCount());
-				assertEquals(Types.INTEGER, cStmt.getParameterMetaData().getParameterType(1));
-				assertEquals(Types.INTEGER, cStmt.getParameterMetaData().getParameterType(2));
+				assertEquals(2, cStmt.getParameterMetaData()
+						.getParameterCount());
+				assertEquals(Types.INTEGER, cStmt.getParameterMetaData()
+						.getParameterType(1));
+				assertEquals(Types.INTEGER, cStmt.getParameterMetaData()
+						.getParameterType(2));
 			}
 		} finally {
 			if (this.rs != null) {
@@ -600,10 +598,10 @@
 
 			try {
 				this.stmt
-				.executeUpdate("DROP PROCEDURE IF EXISTS testBug12417");
+						.executeUpdate("DROP PROCEDURE IF EXISTS testBug12417");
 				this.stmt.executeUpdate("CREATE PROCEDURE testBug12417()\n"
 						+ "BEGIN\n" + "SELECT 1;" + "end\n");
-				ucCatalogConn = getConnectionWithProps((Properties)null);
+				ucCatalogConn = getConnectionWithProps((Properties) null);
 				ucCatalogConn.setCatalog(this.conn.getCatalog().toUpperCase());
 				ucCatalogConn.prepareCall("{call testBug12417()}");
 			} finally {
@@ -620,7 +618,7 @@
 		if (false /* needs to be fixed on server */) {
 			if (versionMeetsMinimum(5, 0)) {
 				this.stmt
-				.executeUpdate("DROP PROCEDURE IF EXISTS p_testBug15121");
+						.executeUpdate("DROP PROCEDURE IF EXISTS p_testBug15121");
 
 				this.stmt.executeUpdate("CREATE PROCEDURE p_testBug15121()\n"
 						+ "BEGIN\n" + "SELECT * from idonotexist;\n" + "END");
@@ -635,7 +633,7 @@
 
 					StringBuffer queryBuf = new StringBuffer("{call ");
 					String quotedId = this.conn.getMetaData()
-					.getIdentifierQuoteString();
+							.getIdentifierQuoteString();
 					queryBuf.append(quotedId);
 					queryBuf.append(this.conn.getCatalog());
 					queryBuf.append(quotedId);
@@ -665,19 +663,18 @@
 		CallableStatement storedProc = null;
 
 		try {
+			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");
 			this.stmt
-			.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");
-			this.stmt
-			.executeUpdate("create procedure testInOutParam(IN p1 VARCHAR(255), INOUT p2 INT)\n"
-					+ "begin\n"
-					+ " DECLARE z INT;\n"
-					+ "SET z = p2 + 1;\n"
-					+ "SET p2 = z;\n"
-					+ "SELECT p1;\n"
-					+ "SELECT CONCAT('zyxw', p1);\n" + "end\n");
+					.executeUpdate("create procedure testInOutParam(IN p1 VARCHAR(255), INOUT p2 INT)\n"
+							+ "begin\n"
+							+ " DECLARE z INT;\n"
+							+ "SET z = p2 + 1;\n"
+							+ "SET p2 = z;\n"
+							+ "SELECT p1;\n"
+							+ "SELECT CONCAT('zyxw', p1);\n"
+							+ "end\n");
 
-			storedProc = this.conn
-			.prepareCall("{call testInOutParam(?, ?)}");
+			storedProc = this.conn.prepareCall("{call testInOutParam(?, ?)}");
 
 			storedProc.setString(1, "abcd");
 			storedProc.setInt(2, 4);
@@ -687,8 +684,7 @@
 
 			assertEquals(5, storedProc.getInt(2));
 		} finally {
-			this.stmt
-			.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");
+			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");
 		}
 	}
 
@@ -708,10 +704,10 @@
 
 		this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug17898");
 		this.stmt
-		.executeUpdate("CREATE PROCEDURE testBug17898(param1 VARCHAR(50), OUT param2
INT)\nBEGIN\nDECLARE rtn INT;\nSELECT 1 INTO rtn;\nSET param2=rtn;\nEND");
+				.executeUpdate("CREATE PROCEDURE testBug17898(param1 VARCHAR(50), OUT param2
INT)\nBEGIN\nDECLARE rtn INT;\nSELECT 1 INTO rtn;\nSET param2=rtn;\nEND");
 
 		CallableStatement cstmt = this.conn
-		.prepareCall("{CALL testBug17898('foo', ?)}");
+				.prepareCall("{CALL testBug17898('foo', ?)}");
 		cstmt.registerOutParameter(1, Types.INTEGER);
 		cstmt.execute();
 		assertEquals(1, cstmt.getInt(1));
@@ -726,10 +722,12 @@
 	}
 
 	/**
-	 * Tests fix for BUG#21462 - JDBC (and ODBC) specifications allow no-parenthesis
-	 * CALL statements for procedures with no arguments, MySQL server does not.
+	 * Tests fix for BUG#21462 - JDBC (and ODBC) specifications allow
+	 * no-parenthesis CALL statements for procedures with no arguments, MySQL
+	 * server does not.
 	 * 
-	 * @throws Exception if the test fails.
+	 * @throws Exception
+	 *             if the test fails.
 	 */
 	public void testBug21462() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
@@ -740,7 +738,8 @@
 
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug21462");
-			this.stmt.executeUpdate("CREATE PROCEDURE testBug21462() BEGIN SELECT 1; END");
+			this.stmt
+					.executeUpdate("CREATE PROCEDURE testBug21462() BEGIN SELECT 1; END");
 			cstmt = this.conn.prepareCall("{CALL testBug21462}");
 			cstmt.execute();
 		} finally {
@@ -753,11 +752,12 @@
 
 	}
 
-	/** 
+	/**
 	 * Tests fix for BUG#22024 - Newlines causing whitespace to span confuse
 	 * procedure parser when getting parameter metadata for stored procedures.
 	 * 
-	 * @throws Exception if the test fails
+	 * @throws Exception
+	 *             if the test fails
 	 */
 	public void testBug22024() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
@@ -768,12 +768,14 @@
 
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug22024");
-			this.stmt.executeUpdate("CREATE PROCEDURE testBug22024(\r\n)\r\n BEGIN SELECT 1;
END");
+			this.stmt
+					.executeUpdate("CREATE PROCEDURE testBug22024(\r\n)\r\n BEGIN SELECT 1; END");
 			cstmt = this.conn.prepareCall("{CALL testBug22024()}");
 			cstmt.execute();
 
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug22024");
-			this.stmt.executeUpdate("CREATE PROCEDURE testBug22024(\r\na INT)\r\n BEGIN SELECT 1;
END");
+			this.stmt
+					.executeUpdate("CREATE PROCEDURE testBug22024(\r\na INT)\r\n BEGIN SELECT 1; END");
 			cstmt = this.conn.prepareCall("{CALL testBug22024(?)}");
 			cstmt.setInt(1, 1);
 			cstmt.execute();
@@ -788,11 +790,12 @@
 	}
 
 	/**
-	 * Tests workaround for server crash when calling stored procedures
-	 * via a server-side prepared statement (driver now detects 
-	 * prepare(stored procedure) and substitutes client-side prepared statement).
+	 * Tests workaround for server crash when calling stored procedures via a
+	 * server-side prepared statement (driver now detects prepare(stored
+	 * procedure) and substitutes client-side prepared statement).
 	 * 
-	 * @throws Exception if the test fails
+	 * @throws Exception
+	 *             if the test fails
 	 */
 	public void testBug22297() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
@@ -803,47 +806,49 @@
 
 		createTable("tblTestBug2297_1", "("
 				+ "id varchar(20) NOT NULL default '',"
-				+ "Income double(19,2) default NULL)");	
+				+ "Income double(19,2) default NULL)");
 
 		createTable("tblTestBug2297_2", "("
-				+ "id varchar(20) NOT NULL default ''," 
+				+ "id varchar(20) NOT NULL default '',"
 				+ "CreatedOn datetime default NULL)");
 
-		this.stmt.executeUpdate("CREATE PROCEDURE testBug22297(pcaseid INT)"
-				+ "BEGIN"
-				+ "\nSET @sql = \"DROP TEMPORARY TABLE IF EXISTS tmpOrders\";"
-				+ " PREPARE stmt FROM @sql;"
-				+ " EXECUTE stmt;"
-				+ " DEALLOCATE PREPARE stmt;"
-				+ "\nSET @sql = \"CREATE TEMPORARY TABLE tmpOrders SELECT id, 100 AS Income FROM
tblTestBug2297_1 GROUP BY id\";"
-				+ " PREPARE stmt FROM @sql;"
-				+ " EXECUTE stmt;"
-				+ " DEALLOCATE PREPARE stmt;"
-				+ "\n SELECT id, Income FROM (SELECT e.id AS id ,COALESCE(prof.Income,0) AS Income"
-				+ "\n FROM tblTestBug2297_2 e LEFT JOIN tmpOrders prof ON e.id = prof.id"
-				+ "\n WHERE e.CreatedOn > '2006-08-01') AS Final ORDER BY id;" 
-				+ "\nEND");
+		this.stmt
+				.executeUpdate("CREATE PROCEDURE testBug22297(pcaseid INT)"
+						+ "BEGIN"
+						+ "\nSET @sql = \"DROP TEMPORARY TABLE IF EXISTS tmpOrders\";"
+						+ " PREPARE stmt FROM @sql;"
+						+ " EXECUTE stmt;"
+						+ " DEALLOCATE PREPARE stmt;"
+						+ "\nSET @sql = \"CREATE TEMPORARY TABLE tmpOrders SELECT id, 100 AS Income FROM
tblTestBug2297_1 GROUP BY id\";"
+						+ " PREPARE stmt FROM @sql;"
+						+ " EXECUTE stmt;"
+						+ " DEALLOCATE PREPARE stmt;"
+						+ "\n SELECT id, Income FROM (SELECT e.id AS id ,COALESCE(prof.Income,0) AS Income"
+						+ "\n FROM tblTestBug2297_2 e LEFT JOIN tmpOrders prof ON e.id = prof.id"
+						+ "\n WHERE e.CreatedOn > '2006-08-01') AS Final ORDER BY id;"
+						+ "\nEND");
 
-		this.stmt.executeUpdate("INSERT INTO tblTestBug2297_1 (`id`,`Income`) VALUES "
-				+ "('a',4094.00),"
-				+ "('b',500.00),"
-				+ "('c',3462.17),"
-				+ " ('d',500.00),"
-				+ " ('e',600.00)");
+		this.stmt
+				.executeUpdate("INSERT INTO tblTestBug2297_1 (`id`,`Income`) VALUES "
+						+ "('a',4094.00),"
+						+ "('b',500.00),"
+						+ "('c',3462.17),"
+						+ " ('d',500.00)," + " ('e',600.00)");
 
-		this.stmt.executeUpdate("INSERT INTO tblTestBug2297_2 (`id`,`CreatedOn`) VALUES "
-				+ "('d','2006-08-31 00:00:00'),"
-				+ "('e','2006-08-31 00:00:00'),"
-				+ "('b','2006-08-31 00:00:00'),"
-				+ "('c','2006-08-31 00:00:00'),"
-				+ "('a','2006-08-31 00:00:00')");
+		this.stmt
+				.executeUpdate("INSERT INTO tblTestBug2297_2 (`id`,`CreatedOn`) VALUES "
+						+ "('d','2006-08-31 00:00:00'),"
+						+ "('e','2006-08-31 00:00:00'),"
+						+ "('b','2006-08-31 00:00:00'),"
+						+ "('c','2006-08-31 00:00:00'),"
+						+ "('a','2006-08-31 00:00:00')");
 
 		try {
 			this.pstmt = this.conn.prepareStatement("{CALL testBug22297(?)}");
 			this.pstmt.setInt(1, 1);
-			this.rs =this.pstmt.executeQuery();
+			this.rs = this.pstmt.executeQuery();
 
-			String[] ids = new String[] { "a", "b", "c", "d", "e"};
+			String[] ids = new String[] { "a", "b", "c", "d", "e" };
 			int pos = 0;
 
 			while (this.rs.next()) {
@@ -864,10 +869,10 @@
 		}
 
 		this.stmt
-		.executeUpdate("DROP PROCEDURE IF EXISTS testHugeNumberOfParameters");
+				.executeUpdate("DROP PROCEDURE IF EXISTS testHugeNumberOfParameters");
 
 		StringBuffer procDef = new StringBuffer(
-		"CREATE PROCEDURE testHugeNumberOfParameters(");
+				"CREATE PROCEDURE testHugeNumberOfParameters(");
 
 		for (int i = 0; i < 274; i++) {
 			if (i != 0) {
@@ -884,15 +889,15 @@
 
 		try {
 			cStmt = this.conn
-			.prepareCall("{call
testHugeNumberOfParameters(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+
+					.prepareCall("{call
testHugeNumberOfParameters(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+
 
-					"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
-					+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
+							"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+
"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+
"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+
"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+
"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+							+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
 			cStmt.registerOutParameter(274, Types.VARCHAR);
 
 			cStmt.execute();
@@ -908,10 +913,9 @@
 			return;
 		}
 
-
 		this.stmt.executeUpdate("Drop procedure if exists p");
 		this.stmt
-		.executeUpdate("create procedure p () begin select 1; select 2; end;");
+				.executeUpdate("create procedure p () begin select 1; select 2; end;");
 		PreparedStatement ps = null;
 
 		try {
@@ -940,9 +944,11 @@
 	}
 
 	/**
-	 * Tests fix for BUG#25379 - INOUT parameters in CallableStatements get doubly-escaped.
+	 * Tests fix for BUG#25379 - INOUT parameters in CallableStatements get
+	 * doubly-escaped.
 	 * 
-	 * @throws Exception if the test fails.
+	 * @throws Exception
+	 *             if the test fails.
 	 */
 	public void testBug25379() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
@@ -953,33 +959,37 @@
 
 		try {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS sp_testBug25379");
-			this.stmt.executeUpdate("CREATE PROCEDURE sp_testBug25379 (INOUT invalue char(255))"
-					+ "\nBEGIN"
-					+ "\ninsert into testBug25379(col) values(invalue);"
-					+ "\nEND");
+			this.stmt
+					.executeUpdate("CREATE PROCEDURE sp_testBug25379 (INOUT invalue char(255))"
+							+ "\nBEGIN"
+							+ "\ninsert into testBug25379(col) values(invalue);"
+							+ "\nEND");
 
-
-			CallableStatement cstmt = this.conn.prepareCall("{call sp_testBug25379(?)}");
-			cstmt.setString(1,"'john'");
+			CallableStatement cstmt = this.conn
+					.prepareCall("{call sp_testBug25379(?)}");
+			cstmt.setString(1, "'john'");
 			cstmt.executeUpdate();
 			assertEquals("'john'", cstmt.getString(1));
-			assertEquals("'john'", getSingleValue("testBug25379", "col", "").toString());
+			assertEquals("'john'", getSingleValue("testBug25379", "col", "")
+					.toString());
 		} finally {
 			this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS sp_testBug25379");
 		}
 	}
 
 	/**
-	 * Tests fix for BUG#25715 - CallableStatements with OUT/INOUT parameters that
-	 * are "binary" have extra 7 bytes (which happens to be the _binary introducer!)
+	 * Tests fix for BUG#25715 - CallableStatements with OUT/INOUT parameters
+	 * that are "binary" have extra 7 bytes (which happens to be the _binary
+	 * introducer!)
 	 * 
-	 * @throws Exception if the test fails.
+	 * @throws Exception
+	 *             if the test fails.
 	 */
 	public void testBug25715() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
 			return; // no stored procs
 		}
-		
+
 		if (isRunningOnJdk131()) {
 			return; // no such method to test
 		}
@@ -996,8 +1006,9 @@
 				buf[i] = 1;
 			int il = buf.length;
 
-			int[] typesToTest = new int[] { Types.BIT, Types.BINARY, Types.BLOB,
Types.JAVA_OBJECT,
-					Types.LONGVARBINARY, Types.VARBINARY };
+			int[] typesToTest = new int[] { Types.BIT, Types.BINARY,
+					Types.BLOB, Types.JAVA_OBJECT, Types.LONGVARBINARY,
+					Types.VARBINARY };
 
 			for (int i = 0; i < typesToTest.length; i++) {
 
@@ -1046,10 +1057,9 @@
 
 		this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testBug26143");
 
-		this.stmt.executeUpdate("CREATE DEFINER=CURRENT_USER PROCEDURE testBug26143(I INT)
COMMENT 'abcdefg'"
-				+ "\nBEGIN\n"
-				+ "SELECT I * 10;"
-				+ "\nEND");
+		this.stmt
+				.executeUpdate("CREATE DEFINER=CURRENT_USER PROCEDURE testBug26143(I INT) COMMENT
'abcdefg'"
+						+ "\nBEGIN\n" + "SELECT I * 10;" + "\nEND");
 
 		this.conn.prepareCall("{call testBug26143(?)").close();
 	}
@@ -1057,7 +1067,8 @@
 	/**
 	 * Tests fix for BUG#26959 - comments confuse procedure parser.
 	 * 
-	 * @throws Exception if the test fails
+	 * @throws Exception
+	 *             if the test fails
 	 */
 	public void testBug26959() throws Exception {
 		if (!serverSupportsStoredProcedures()) {
@@ -1067,36 +1078,36 @@
 		createProcedure(
 				"testBug26959",
 				"(_ACTION varchar(20),"
-				+ "\n`/*dumb-identifier-1*/` int,"
-				+ "\n`#dumb-identifier-2` int,"
-				+ "\n`--dumb-identifier-3` int,"
-				+ "\n_CLIENT_ID int, -- ABC"
-				+ "\n_LOGIN_ID  int, # DEF"
-				+ "\n_WHERE varchar(2000),"
-				+ "\n_SORT varchar(2000),"
-				+ "\n out _SQL varchar(/* inline right here - oh my gosh! */ 8000),"
-				+ "\n _SONG_ID int,"
-				+ "\n  _NOTES varchar(2000),"
-				+ "\n out _RESULT varchar(10)"
-				+ "\n /*"
-				+ "\n ,    -- Generic result parameter"
-				+ "\n out _PERIOD_ID int,         -- Returns the period_id. Useful when using
@PREDEFLINK to return which is the last period"
-				+ "\n   _SONGS_LIST varchar(8000),"
-				+ "\n  _COMPOSERID int,"
-				+ "\n  _PUBLISHERID int,"
-				+ "\n   _PREDEFLINK int        -- If the user is accessing through a predefined link:
0=none  1=last period"
-				+ "\n */) BEGIN SELECT 1; END");
+						+ "\n`/*dumb-identifier-1*/` int,"
+						+ "\n`#dumb-identifier-2` int,"
+						+ "\n`--dumb-identifier-3` int,"
+						+ "\n_CLIENT_ID int, -- ABC"
+						+ "\n_LOGIN_ID  int, # DEF"
+						+ "\n_WHERE varchar(2000),"
+						+ "\n_SORT varchar(2000),"
+						+ "\n out _SQL varchar(/* inline right here - oh my gosh! */ 8000),"
+						+ "\n _SONG_ID int,"
+						+ "\n  _NOTES varchar(2000),"
+						+ "\n out _RESULT varchar(10)"
+						+ "\n /*"
+						+ "\n ,    -- Generic result parameter"
+						+ "\n out _PERIOD_ID int,         -- Returns the period_id. Useful when using
@PREDEFLINK to return which is the last period"
+						+ "\n   _SONGS_LIST varchar(8000),"
+						+ "\n  _COMPOSERID int,"
+						+ "\n  _PUBLISHERID int,"
+						+ "\n   _PREDEFLINK int        -- If the user is accessing through a predefined
link: 0=none  1=last period"
+						+ "\n */) BEGIN SELECT 1; END");
 
 		createProcedure(
 				"testBug26959_1",
 				"(`/*id*/` /* before type 1 */ varchar(20),"
-				+ "/* after type 1 */ OUT result2 DECIMAL(/*size1*/10,/*size2*/2) /* p2 */)"
-				+ "BEGIN SELECT action, result; END");
+						+ "/* after type 1 */ OUT result2 DECIMAL(/*size1*/10,/*size2*/2) /* p2 */)"
+						+ "BEGIN SELECT action, result; END");
 
 		try {
 			this.conn.prepareCall(
-			"{call testBug26959(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}")
-			.close();
+					"{call testBug26959(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}")
+					.close();
 			this.rs = this.conn.getMetaData().getProcedureColumns(
 					this.conn.getCatalog(), null, "testBug26959", "%");
 
@@ -1175,13 +1186,17 @@
 			return; // SPs not supported
 		}
 
-		createProcedure("testBug27400", "(a INT, b VARCHAR(32)) BEGIN SELECT 1; END");
+		createProcedure("testBug27400",
+				"(a INT, b VARCHAR(32)) BEGIN SELECT 1; END");
 
 		CallableStatement cStmt = null;
 
 		try {
-			cStmt = this.conn.prepareCall("{CALL /* SOME COMMENT */ testBug27400( /* does this
work too? */ ?, ?)} # and a commented ? here too");
-			assertTrue(cStmt.toString().indexOf("/*") != -1); // we don't want to strip the
comments
+			cStmt = this.conn
+					.prepareCall("{CALL /* SOME COMMENT */ testBug27400( /* does this work too? */ ?,
?)} # and a commented ? here too");
+			assertTrue(cStmt.toString().indexOf("/*") != -1); // we don't want
+																// to strip the
+																// comments
 			cStmt.setInt(1, 1);
 			cStmt.setString(2, "bleh");
 			cStmt.execute();
@@ -1191,15 +1206,15 @@
 			}
 		}
 	}
-	
+
 	/**
-	 * Tests fix for BUG#28689 - CallableStatement.executeBatch()
-	 * doesn't work when connection property "noAccessToProcedureBodies"
-	 * has been set to "true".
+	 * Tests fix for BUG#28689 - CallableStatement.executeBatch() doesn't work
+	 * when connection property "noAccessToProcedureBodies" has been set to
+	 * "true".
 	 * 
-	 * The fix involves changing the behavior of "noAccessToProcedureBodies",
-	 * in that the driver will now report all paramters as "IN" paramters
-	 * but allow callers to call registerOutParameter() on them.
+	 * The fix involves changing the behavior of "noAccessToProcedureBodies", in
+	 * that the driver will now report all paramters as "IN" paramters but allow
+	 * callers to call registerOutParameter() on them.
 	 * 
 	 * @throws Exception
 	 */
@@ -1207,46 +1222,51 @@
 		if (!versionMeetsMinimum(5, 0)) {
 			return; // no stored procedures
 		}
-		
+
 		createTable("testBug28689", "(" +
-				
-				  "`id` int(11) NOT NULL auto_increment,"
-				  + "`usuario` varchar(255) default NULL,"
-				  + "PRIMARY KEY  (`id`)"
-				+ ")"); 
 
-		this.stmt.executeUpdate("INSERT INTO testBug28689 (usuario) VALUES ('AAAAAA')");
+		"`id` int(11) NOT NULL auto_increment,"
+				+ "`usuario` varchar(255) default NULL,"
+				+ "PRIMARY KEY  (`id`)" + ")");
 
-		createProcedure("sp_testBug28689", "(tid INT)"
-				+ "\nBEGIN"
-				+ "\nUPDATE testBug28689 SET usuario = 'BBBBBB' WHERE id = tid;"
-				+ "\nEND");
+		this.stmt
+				.executeUpdate("INSERT INTO testBug28689 (usuario) VALUES ('AAAAAA')");
 
+		createProcedure(
+				"sp_testBug28689",
+				"(tid INT)"
+						+ "\nBEGIN"
+						+ "\nUPDATE testBug28689 SET usuario = 'BBBBBB' WHERE id = tid;"
+						+ "\nEND");
+
 		Connection noProcedureBodiesConn =
getConnectionWithProps("noAccessToProcedureBodies=true");
 		CallableStatement cStmt = null;
-		
+
 		try {
-			cStmt = noProcedureBodiesConn.prepareCall("{CALL sp_testBug28689(?)}");
+			cStmt = noProcedureBodiesConn
+					.prepareCall("{CALL sp_testBug28689(?)}");
 			cStmt.setInt(1, 1);
 			cStmt.addBatch();
 			cStmt.executeBatch();
-			
-			assertEquals("BBBBBB", getSingleIndexedValueWithQuery(noProcedureBodiesConn, 1,
"SELECT `usuario` FROM testBug28689 WHERE id=1"));
+
+			assertEquals("BBBBBB", getSingleIndexedValueWithQuery(
+					noProcedureBodiesConn, 1,
+					"SELECT `usuario` FROM testBug28689 WHERE id=1"));
 		} finally {
 			if (cStmt != null) {
 				cStmt.close();
 			}
-			
+
 			if (noProcedureBodiesConn != null) {
 				noProcedureBodiesConn.close();
 			}
 		}
 	}
-	
-	/** 
+
+	/**
 	 * Tests fix for Bug#31823 - CallableStatement.setNull() on a stored
-	 * function would throw an ArrayIndexOutOfBounds when setting the 
-	 * last parameter to null when calling setNull().
+	 * function would throw an ArrayIndexOutOfBounds when setting the last
+	 * parameter to null when calling setNull().
 	 * 
 	 * @throws Exception
 	 */
@@ -1397,20 +1417,21 @@
 			}
 		}
 	}
-	
+
 	/**
-	 * Tests fix for Bug#32246 - When unpacking rows directly, we don't
-	 * hand off error message packets to the internal method which decodes
-	 * them correctly, so no exception is rasied, and the driver than hangs
-	 * trying to read rows that aren't there...
+	 * Tests fix for Bug#32246 - When unpacking rows directly, we don't hand off
+	 * error message packets to the internal method which decodes them
+	 * correctly, so no exception is rasied, and the driver than hangs trying to
+	 * read rows that aren't there...
 	 * 
-	 * @throws Exception if the test fails
+	 * @throws Exception
+	 *             if the test fails
 	 */
 	public void testBug32246() throws Exception {
 		if (!versionMeetsMinimum(5, 0)) {
 			return;
 		}
-		
+
 		doBug32246(this.conn);
 		dropTable("test_table_2");
 		dropTable("test_table_1");
@@ -1418,46 +1439,53 @@
 	}
 
 	private void doBug32246(Connection aConn) throws SQLException {
-		createTable("test_table_1", "(value_1 BIGINT PRIMARY KEY) ENGINE=InnoDB");
+		createTable("test_table_1",
+				"(value_1 BIGINT PRIMARY KEY) ENGINE=InnoDB");
 		this.stmt.executeUpdate("INSERT INTO test_table_1 VALUES (1)");
-		createTable("test_table_2", "(value_2 BIGINT PRIMARY KEY) ENGINE=InnoDB");
+		createTable("test_table_2",
+				"(value_2 BIGINT PRIMARY KEY) ENGINE=InnoDB");
 		this.stmt.executeUpdate("DROP FUNCTION IF EXISTS test_function");
-		createFunction("test_function", "() RETURNS BIGINT " +
-				"DETERMINISTIC MODIFIES SQL DATA BEGIN " +
-				"DECLARE max_value BIGINT; " +
-				"SELECT MAX(value_1) INTO max_value FROM test_table_2; " +
-				"RETURN max_value; END;");
+		createFunction("test_function", "() RETURNS BIGINT "
+				+ "DETERMINISTIC MODIFIES SQL DATA BEGIN "
+				+ "DECLARE max_value BIGINT; "
+				+ "SELECT MAX(value_1) INTO max_value FROM test_table_2; "
+				+ "RETURN max_value; END;");
 
 		CallableStatement callable = null;
-		
+
 		try {
 			callable = aConn.prepareCall("{? = call test_function()}");
 
-			callable.registerOutParameter(1,Types.BIGINT);
-	
+			callable.registerOutParameter(1, Types.BIGINT);
+
 			try {
 				callable.executeUpdate();
 				fail("impossible; we should never get here.");
 			} catch (SQLException sqlEx) {
 				assertEquals("42S22", sqlEx.getSQLState());
 			}
-			
-			createTable("test_table_1", "(value_1 BIGINT PRIMARY KEY) ENGINE=InnoDB");
+
+			createTable("test_table_1",
+					"(value_1 BIGINT PRIMARY KEY) ENGINE=InnoDB");
 			this.stmt.executeUpdate("INSERT INTO test_table_1 VALUES (1)");
-			createTable("test_table_2", "(value_2 BIGINT PRIMARY KEY, " +
-					" FOREIGN KEY (value_2) REFERENCES test_table_1 (value_1) ON DELETE CASCADE)
ENGINE=InnoDB");
-			createFunction("test_function", "(value BIGINT) RETURNS BIGINT " +
-					"DETERMINISTIC MODIFIES SQL DATA BEGIN " +
-					"INSERT INTO test_table_2 VALUES (value); RETURN value; END;"); 
-	
+			createTable(
+					"test_table_2",
+					"(value_2 BIGINT PRIMARY KEY, "
+							+ " FOREIGN KEY (value_2) REFERENCES test_table_1 (value_1) ON DELETE CASCADE)
ENGINE=InnoDB");
+			createFunction(
+					"test_function",
+					"(value BIGINT) RETURNS BIGINT "
+							+ "DETERMINISTIC MODIFIES SQL DATA BEGIN "
+							+ "INSERT INTO test_table_2 VALUES (value); RETURN value; END;");
+
 			callable = aConn.prepareCall("{? = call test_function(?)}");
-			callable.registerOutParameter(1,Types.BIGINT);
-	
-			callable.setLong(2,1);
+			callable.registerOutParameter(1, Types.BIGINT);
+
+			callable.setLong(2, 1);
 			callable.executeUpdate();
-	
-			callable.setLong(2,2);
-			
+
+			callable.setLong(2, 2);
+
 			try {
 				callable.executeUpdate();
 				fail("impossible; we should never get here.");
@@ -1470,4 +1498,55 @@
 			}
 		}
 	}
+
+	public void testBitSp() throws Exception {
+		if (!versionMeetsMinimum(5, 0)) {
+			return;
+		}
+
+		createTable("`Bit_Tab`", "(" + " `MAX_VAL` tinyint(1) default NULL,"
+				+ " `MIN_VAL` tinyint(1) default NULL,"
+				+ " `NULL_VAL` tinyint(1) default NULL)");
+
+		createProcedure(
+				"Bit_Proc",
+				"(out MAX_PARAM TINYINT, out MIN_PARAM TINYINT, out NULL_PARAM TINYINT)"
+						+ "begin select MAX_VAL, MIN_VAL, NULL_VAL  into MAX_PARAM, MIN_PARAM, NULL_PARAM
from Bit_Tab; end");
+
+		Boolean minBooleanVal;
+		Boolean oRetVal;
+
+		String Min_Val_Query = "SELECT MIN_VAL from Bit_Tab";
+		String sMaxBooleanVal = "1";
+		// sMaxBooleanVal = "true";
+		Boolean bool = Boolean.valueOf("true");
+		String Min_Insert = "insert into Bit_Tab values(1,0,null)";
+		// System.out.println("Value to insert=" + extractVal(Min_Insert,1));
+		CallableStatement cstmt;
+
+		stmt.executeUpdate("delete from Bit_Tab");
+		stmt.executeUpdate(Min_Insert);
+		cstmt = conn.prepareCall("{call Bit_Proc(?,?,?)}");
+
+		System.out.println("register the output parameters");
+		cstmt.registerOutParameter(1, java.sql.Types.BIT);
+		cstmt.registerOutParameter(2, java.sql.Types.BIT);
+		cstmt.registerOutParameter(3, java.sql.Types.BIT);
+
+		System.out.println("execute the procedure");
+		cstmt.executeUpdate();
+
+		System.out.println("invoke getBoolean method");
+		boolean bRetVal = cstmt.getBoolean(2);
+		oRetVal = new Boolean(bRetVal);
+		minBooleanVal = new Boolean("false");
+		rs = stmt.executeQuery(Min_Val_Query);
+		if (oRetVal.equals(minBooleanVal))
+			System.out.println("getBoolean returns the Minimum value ");
+		else {
+			System.out
+					.println("getBoolean() did not return the Minimum value, getBoolean Failed!");
+
+		}
+	}
 }
\ No newline at end of file

Modified: trunk/src/testsuite/regression/ResultSetRegressionTest.java
===================================================================
--- trunk/src/testsuite/regression/ResultSetRegressionTest.java	2008-01-31 04:59:17 UTC
(rev 6717)
+++ trunk/src/testsuite/regression/ResultSetRegressionTest.java	2008-01-31 05:10:51 UTC
(rev 6718)
@@ -25,6 +25,7 @@
 package testsuite.regression;
 
 import java.io.Reader;
+import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
@@ -54,6 +55,7 @@
 import com.mysql.jdbc.MysqlDataTruncation;
 import com.mysql.jdbc.NotUpdatable;
 import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.StringUtils;
 import com.mysql.jdbc.Util;
 import com.mysql.jdbc.log.StandardLogger;
 
@@ -4460,7 +4462,7 @@
 			this.stmt
 					.executeUpdate("insert into testBug30664_1 values (1),(2),(3)");
 			this.stmt
-					.executeUpdate("insert into testBug30664_2 values (1,'+					.executeUpdate("insert into testBug30664_2 values
(1,'���'),(2,'����'),(3,' ���')");
 			this.rs = this.stmt
 					.executeQuery("select testBug30664_1.id, (select testBug30664_2.binaryvalue from
testBug30664_2 where testBug30664_2.id=testBug30664_1.id) as value from testBug30664_1");
 			ResultSetMetaData tblMD = this.rs.getMetaData();
@@ -4508,7 +4510,7 @@
 		}        
 	}
 	
-	/**
+		/**
 	 * Tests fix for Bug#33678 - Multiple result sets not supported in
 	 * "streaming" mode. This fix covers both normal statements, and stored
 	 * procedures, with the exception of stored procedures with registered 
@@ -4588,4 +4590,15 @@
 			closeMemberJDBCResources();
 		}
 	}
+	
+	public void testBug33162() throws Exception {
+		if (!versionMeetsMinimum(5, 0)) {
+			return;
+		}
+		
+		this.rs = this.stmt.executeQuery("select now() from dual where 1=0");
+		this.rs.next();
+		this.rs.getTimestamp(1);  // fails
+	}
+	
 }

Modified: trunk/src/testsuite/regression/StatementRegressionTest.java
===================================================================
--- trunk/src/testsuite/regression/StatementRegressionTest.java	2008-01-31 04:59:17 UTC
(rev 6717)
+++ trunk/src/testsuite/regression/StatementRegressionTest.java	2008-01-31 05:10:51 UTC
(rev 6718)
@@ -31,33 +31,47 @@
 import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.PrintStream;
+import java.io.Reader;
 import java.io.StringReader;
 import java.io.Writer;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.net.URL;
+import java.sql.Array;
 import java.sql.BatchUpdateException;
 import java.sql.Blob;
+import java.sql.CallableStatement;
 import java.sql.Clob;
 import java.sql.Connection;
 import java.sql.DataTruncation;
 import java.sql.Date;
 import java.sql.PreparedStatement;
+import java.sql.Ref;
 import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
 import java.sql.Statement;
+import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Types;
+import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Properties;
 import java.util.TimeZone;
 
 import testsuite.BaseTestCase;
 
+import com.mysql.jdbc.CachedResultSetMetaData;
+import com.mysql.jdbc.Field;
+import com.mysql.jdbc.ResultSetInternalMethods;
 import com.mysql.jdbc.SQLError;
 import com.mysql.jdbc.ServerPreparedStatement;
+import com.mysql.jdbc.StatementImpl;
 import com.mysql.jdbc.exceptions.MySQLTimeoutException;
 
 /**
@@ -4272,7 +4286,7 @@
 			this.pstmt.executeUpdate();
 
 			ts = new Timestamp(later);
-			this.pstmt.setInt(1, 1);
+			this.pstmt.setInt(1, 2);
 			this.pstmt.setTimestamp(2, ts);
 			this.pstmt.setTimestamp(3, ts);
 			this.pstmt.executeUpdate();
@@ -4302,6 +4316,11 @@
 			assertEquals(later, timestampSeconds2);
 			assertEquals(earlier, datetimeSeconds1);
 			assertEquals(earlier, timestampSeconds1);
+			
+			SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm z");
+			sdf.setTimeZone(TimeZone.getTimeZone("America/New York"));
+			System.out.println(sdf.format(ts2));
+			System.out.println(sdf.format(ts1));
 		} finally {
 			closeMemberJDBCResources();
 
@@ -4360,4 +4379,971 @@
 			}
 		}
 	}
-}
+
+	public void testMoreLanceBugs() throws Exception {
+		if (!versionMeetsMinimum(5, 0)) {
+			return;
+		}
+
+		createTable("Bit_Tab", "( `MAX_VAL` BIT default NULL, "
+				+ "`MIN_VAL` BIT default NULL, `NULL_VAL` BIT default NULL) "
+				+ "ENGINE=InnoDB DEFAULT CHARSET=latin1");
+		//this.stmt.execute("insert into Bit_Tab values(null,0,null)");
+		createProcedure(
+				"Bit_Proc",
+				"(out MAX_PARAM TINYINT, out MIN_PARAM TINYINT, out NULL_PARAM TINYINT) "
+						+ "begin select MAX_VAL, MIN_VAL, NULL_VAL  into MAX_PARAM, MIN_PARAM, NULL_PARAM
from Bit_Tab; end ");
+
+		Boolean minBooleanVal;
+		Boolean oRetVal;
+		ResultSet rs;
+		String Min_Val_Query = "SELECT MIN_VAL from Bit_Tab";
+		String sMaxBooleanVal = "1";
+		//sMaxBooleanVal = "true";
+		Boolean bool = Boolean.valueOf("true");
+		String Min_Insert = "insert into Bit_Tab values(1,0,null)";
+		//System.out.println("Value to insert=" + extractVal(Min_Insert,1));
+		CallableStatement cstmt;
+		
+		stmt.executeUpdate("delete from Bit_Tab");
+		stmt.executeUpdate(Min_Insert);
+		cstmt = conn.prepareCall("{call Bit_Proc(?,?,?)}");
+
+		cstmt.registerOutParameter(1, java.sql.Types.BIT);
+		cstmt.registerOutParameter(2, java.sql.Types.BIT);
+		cstmt.registerOutParameter(3, java.sql.Types.BIT);
+
+		cstmt.executeUpdate();
+
+		boolean bRetVal = cstmt.getBoolean(2);
+		oRetVal = new Boolean(bRetVal);
+		minBooleanVal = new Boolean("false");
+		rs = stmt.executeQuery(Min_Val_Query);
+		assertEquals(minBooleanVal, oRetVal);
+	}
+
+	public void testBug33823() {
+		new ResultSetInternalMethods() {
+
+			public void buildIndexMapping() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void clearNextResult() {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public ResultSetInternalMethods copy() throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public char getFirstCharOfQuery() {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public ResultSetInternalMethods getNextResultSet() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObjectStoredProc(int columnIndex,
+					int desiredSqlType) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObjectStoredProc(int i, Map map, int desiredSqlType)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObjectStoredProc(String columnName,
+					int desiredSqlType) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObjectStoredProc(String colName, Map map,
+					int desiredSqlType) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public String getServerInfo() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public long getUpdateCount() {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public long getUpdateID() {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public void initializeFromCachedMetaData(
+					CachedResultSetMetaData cachedMetaData) {
+				cachedMetaData.getFields();
+				
+			}
+
+			public void initializeWithMetadata() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void populateCachedMetaData(
+					CachedResultSetMetaData cachedMetaData) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void realClose(boolean calledExplicitly) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean reallyResult() {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public void redefineFieldsForDBMD(Field[] metadataFields) {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void setFirstCharOfQuery(char firstCharUpperCase) {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void setOwningStatement(StatementImpl owningStatement) {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void setStatementUsedForFetchingRows(
+					com.mysql.jdbc.PreparedStatement stmt) {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void setWrapperStatement(Statement wrapperStatement) {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean absolute(int row) throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public void afterLast() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void beforeFirst() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void cancelRowUpdates() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void clearWarnings() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void close() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void deleteRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public int findColumn(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public boolean first() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public Array getArray(int i) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Array getArray(String colName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getAsciiStream(int columnIndex)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getAsciiStream(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public BigDecimal getBigDecimal(int columnIndex)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public BigDecimal getBigDecimal(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public BigDecimal getBigDecimal(int columnIndex, int scale)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public BigDecimal getBigDecimal(String columnName, int scale)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getBinaryStream(int columnIndex)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getBinaryStream(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Blob getBlob(int i) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Blob getBlob(String colName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public boolean getBoolean(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean getBoolean(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public byte getByte(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public byte getByte(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public byte[] getBytes(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public byte[] getBytes(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Reader getCharacterStream(int columnIndex)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Reader getCharacterStream(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Clob getClob(int i) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Clob getClob(String colName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public int getConcurrency() throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public String getCursorName() throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Date getDate(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Date getDate(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Date getDate(int columnIndex, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Date getDate(String columnName, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public double getDouble(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public double getDouble(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public int getFetchDirection() throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public int getFetchSize() throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public float getFloat(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public float getFloat(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public int getInt(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public int getInt(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public long getLong(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public long getLong(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public ResultSetMetaData getMetaData() throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObject(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObject(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObject(int arg0, Map arg1) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Object getObject(String arg0, Map arg1) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Ref getRef(int i) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Ref getRef(String colName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public int getRow() throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public short getShort(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public short getShort(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public Statement getStatement() throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public String getString(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public String getString(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Time getTime(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Time getTime(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Time getTime(int columnIndex, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Time getTime(String columnName, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Timestamp getTimestamp(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Timestamp getTimestamp(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Timestamp getTimestamp(int columnIndex, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public Timestamp getTimestamp(String columnName, Calendar cal)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public int getType() throws SQLException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			public URL getURL(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public URL getURL(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getUnicodeStream(int columnIndex)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public InputStream getUnicodeStream(String columnName)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public SQLWarning getWarnings() throws SQLException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			public void insertRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean isAfterLast() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean isBeforeFirst() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean isFirst() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean isLast() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean last() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public void moveToCurrentRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void moveToInsertRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean next() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean previous() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public void refreshRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean relative(int rows) throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean rowDeleted() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean rowInserted() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public boolean rowUpdated() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			public void setFetchDirection(int direction) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void setFetchSize(int rows) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateArray(int columnIndex, Array x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateArray(String columnName, Array x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateAsciiStream(int columnIndex, InputStream x,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateAsciiStream(String columnName, InputStream x,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBigDecimal(int columnIndex, BigDecimal x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBigDecimal(String columnName, BigDecimal x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBinaryStream(int columnIndex, InputStream x,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBinaryStream(String columnName, InputStream x,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBlob(int columnIndex, Blob x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBlob(String columnName, Blob x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBoolean(int columnIndex, boolean x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBoolean(String columnName, boolean x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateByte(int columnIndex, byte x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateByte(String columnName, byte x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBytes(int columnIndex, byte[] x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateBytes(String columnName, byte[] x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateCharacterStream(int columnIndex, Reader x,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateCharacterStream(String columnName, Reader reader,
+					int length) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateClob(int columnIndex, Clob x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateClob(String columnName, Clob x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateDate(int columnIndex, Date x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateDate(String columnName, Date x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateDouble(int columnIndex, double x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateDouble(String columnName, double x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateFloat(int columnIndex, float x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateFloat(String columnName, float x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateInt(int columnIndex, int x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateInt(String columnName, int x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateLong(int columnIndex, long x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateLong(String columnName, long x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateNull(int columnIndex) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateNull(String columnName) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateObject(int columnIndex, Object x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateObject(String columnName, Object x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateObject(int columnIndex, Object x, int scale)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateObject(String columnName, Object x, int scale)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateRef(int columnIndex, Ref x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateRef(String columnName, Ref x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateRow() throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateShort(int columnIndex, short x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateShort(String columnName, short x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateString(int columnIndex, String x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateString(String columnName, String x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateTime(int columnIndex, Time x) throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateTime(String columnName, Time x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateTimestamp(int columnIndex, Timestamp x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public void updateTimestamp(String columnName, Timestamp x)
+					throws SQLException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			public boolean wasNull() throws SQLException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+		};
+	}
+	
+	/**
+	 * Tests fix for BUG#30493 - Statements with batched values do not
+	 * return correct values for getGeneratedKeys() when "rewriteBatchedStatements"
+	 * is set to "true", and the statement has an "ON DUPLICATE KEY UPDATE" clause.
+	 * 
+	 * @throws Exception if the test fails.
+	 */
+	public void testBug30493() throws Exception {
+		Connection rewriteConn = null;
+		
+		try {
+			String ddl = "(autoIncId INT NOT NULL PRIMARY KEY AUTO_INCREMENT, uniqueTextKey
VARCHAR(255) UNIQUE KEY)";
+			createTable("testBug30493", ddl);
+			
+			String [] sequence = {"c", "a", "d", "b"};
+			String sql = "insert into testBug30493 (uniqueTextKey) values (?) on duplicate key
UPDATE autoIncId = last_insert_id( autoIncId )";
+			String tablePrimeSql = "INSERT INTO testBug30493 (uniqueTextKey) VALUES ('a'), ('b'),
('c'), ('d')";
+			
+			this.stmt.executeUpdate(tablePrimeSql);
+			this.pstmt = this.conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
+			
+			for (int i = 0; i < sequence.length; i++) {
+				this.pstmt.setString(1, sequence[i]);
+				this.pstmt.addBatch();
+			}
+			
+			this.pstmt.executeBatch();
+			
+			ResultSet nonRewrittenRsKeys = this.pstmt.getGeneratedKeys();
+	
+			createTable("testBug30493", ddl);
+			this.stmt.executeUpdate(tablePrimeSql);
+			
+			rewriteConn = getConnectionWithProps("rewriteBatchedStatements=true");
+			
+			this.pstmt = rewriteConn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
+			
+			for (int i = 0; i < sequence.length; i++) {
+				this.pstmt.setString(1, sequence[i]);
+				this.pstmt.addBatch();
+			}
+			
+			this.pstmt.executeBatch();
+			ResultSet rewrittenRsKeys = this.pstmt.getGeneratedKeys();
+			
+			assertResultSetsEqual(nonRewrittenRsKeys, rewrittenRsKeys);
+		} finally {
+			closeMemberJDBCResources();
+			
+			if (rewriteConn != null) {
+				rewriteConn.close();
+			}
+		}
+	}
+}
\ No newline at end of file

Thread
Connector/J commit: r6718 - in trunk: . src/com/mysql/jdbc src/testsuite src/testsuite/regressionmmatthews31 Jan 2008