List:Commits« Previous MessageNext Message »
From:mmatthews Date:December 19 2005 4:10pm
Subject:Connector/J commit: r4705 - in branches/branch_3_1/connector-j: . src/com/mysql/jdbc src/testsuite/regression
View as plain text  
Modified:
   branches/branch_3_1/connector-j/CHANGES
   branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlIO.java
   branches/branch_3_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java
Log:
Fixed BUG#14609 - Exception thrown for new decimal type when 
      using updatable result sets.

Modified: branches/branch_3_1/connector-j/CHANGES
===================================================================
--- branches/branch_3_1/connector-j/CHANGES	2005-12-19 16:06:25 UTC (rev 4704)
+++ branches/branch_3_1/connector-j/CHANGES	2005-12-19 16:10:33 UTC (rev 4705)
@@ -5,6 +5,9 @@
 
     - Fixed BUG#15464 - INOUT parameter does not store IN value.
     
+    - Fixed BUG#14609 - Exception thrown for new decimal type when 
+      using updatable result sets.
+    
 11-30-05 - Version 3.1.12
 
     - Fixed client-side prepared statement bug with embedded ? inside

Modified: branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlIO.java
===================================================================
--- branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlIO.java	2005-12-19 16:06:25 UTC (rev 4704)
+++ branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlIO.java	2005-12-19 16:10:33 UTC (rev 4705)
@@ -4141,6 +4141,7 @@
     	case MysqlDefs.FIELD_TYPE_STRING:
     	case MysqlDefs.FIELD_TYPE_VARCHAR:
     	case MysqlDefs.FIELD_TYPE_DECIMAL:
+    	case MysqlDefs.FIELD_TYPE_NEW_DECIMAL:
     	case MysqlDefs.FIELD_TYPE_GEOMETRY:
     		unpackedRowData[columnIndex] = binaryData.readLenByteArray(0);
     		

Modified: branches/branch_3_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java
===================================================================
--- branches/branch_3_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java	2005-12-19 16:06:25 UTC (rev 4704)
+++ branches/branch_3_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java	2005-12-19 16:10:33 UTC (rev 4705)
@@ -2201,6 +2201,39 @@
 		this.rs.findColumn("table2.id");
 	}
 	
+	/**
+	 * Tests fix for BUG#14609 - Exception thrown for new decimal
+	 * type when using updatable result sets.
+	 * 
+	 * @throws Exception if the test fails
+	 */
+	public void testBug14609() throws Exception {
+		if (versionMeetsMinimum(5, 0)) {
+			createTable("testBug14609", "(field1 int primary key, field2 decimal)");
+			this.stmt.executeUpdate("INSERT INTO testBug14609 VALUES (1, 1)");
+			
+			PreparedStatement updatableStmt = this.conn.prepareStatement(
+					"SELECT field1, field2 FROM testBug14609",
+					ResultSet.TYPE_SCROLL_INSENSITIVE,
+					ResultSet.CONCUR_UPDATABLE);
+			
+			
+			try {
+				this.rs = updatableStmt.executeQuery();
+			} finally {
+				if (this.rs != null) {
+					ResultSet toClose = this.rs;
+					this.rs = null;
+					toClose.close();
+				}
+				
+				if (updatableStmt != null) {
+					updatableStmt.close();
+				}
+			}
+		}
+	}
+	
 	private void traverseResultSetBug14562() throws SQLException {
 		assertTrue(this.rs.next());
 		

Thread
Connector/J commit: r4705 - in branches/branch_3_1/connector-j: . src/com/mysql/jdbc src/testsuite/regressionmmatthews19 Dec