From: mmatthews Date: December 19 2005 4:14pm Subject: Connector/J commit: r4706 - in branches/branch_5_0/connector-j: . src/com/mysql/jdbc src/testsuite/regression List-Archive: http://lists.mysql.com/commits/261 X-Bug: 14609 Message-Id: <200512191614.jBJGE7W5014871@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/branch_5_0/connector-j/CHANGES branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java branches/branch_5_0/connector-j/src/testsuite/regression/ResultSetRegressionTest.java Log: Fixed BUG#14609 - Exception thrown for new decimal type when using updatable result sets (merged from 3.1 branch) Modified: branches/branch_5_0/connector-j/CHANGES =================================================================== --- branches/branch_5_0/connector-j/CHANGES 2005-12-19 16:10:33 UTC (rev 4705) +++ branches/branch_5_0/connector-j/CHANGES 2005-12-19 16:14:05 UTC (rev 4706) @@ -91,6 +91,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 Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java =================================================================== --- branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java 2005-12-19 16:10:33 UTC (rev 4705) +++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java 2005-12-19 16:14:05 UTC (rev 4706) @@ -3708,6 +3708,7 @@ case MysqlDefs.FIELD_TYPE_STRING: case MysqlDefs.FIELD_TYPE_VARCHAR: case MysqlDefs.FIELD_TYPE_DECIMAL: + case MysqlDefs.FIELD_TYPE_NEW_DECIMAL: unpackedRowData[columnIndex] = binaryData.readLenByteArray(0); break; Modified: branches/branch_5_0/connector-j/src/testsuite/regression/ResultSetRegressionTest.java =================================================================== --- branches/branch_5_0/connector-j/src/testsuite/regression/ResultSetRegressionTest.java 2005-12-19 16:10:33 UTC (rev 4705) +++ branches/branch_5_0/connector-j/src/testsuite/regression/ResultSetRegressionTest.java 2005-12-19 16:14:05 UTC (rev 4706) @@ -2815,4 +2815,37 @@ assertEquals("java.lang.Integer", this.rs.getObject(1).getClass().getName()); assertEquals("java.lang.Integer", this.rs.getObject(2).getClass().getName()); } + + /** + * 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(); + } + } + } + } }