Modified:
branches/branch_5_1/CHANGES
branches/branch_5_1/src/com/mysql/jdbc/Blob.java
branches/branch_5_1/src/testsuite/regression/BlobRegressionTest.java
Log:
Fixed BUG#34677 - Blob.truncate() wouldn't take "0" as an argument.
Modified: branches/branch_5_1/CHANGES
===================================================================
--- branches/branch_5_1/CHANGES 2008-02-15 21:30:33 UTC (rev 6733)
+++ branches/branch_5_1/CHANGES 2008-02-20 17:13:12 UTC (rev 6734)
@@ -117,7 +117,13 @@
- CallableStatements that aren't really stored procedure or stored function calls can
now be used, for tools such as Oracle JDeveloper ADF that issue statements such as
DDL through CallableStatements.
-
+
+ - Fixed BUG#34518 - Statements using cursor fetch leaked internal prepared statements
+ until connection was closed. The internal prepared statement is now held open while
+ the result set is open, and closed by the result set itself being closed.
+
+ - Fixed BUG#34677 - Blob.truncate() wouldn't take "0" as an argument.
+
- CommunicationExceptions now carry information about the last time a packet
was received from the MySQL server, as well as when the last packet was sent
to one, in an effort to make it easier to debug communications errors caused
Modified: branches/branch_5_1/src/com/mysql/jdbc/Blob.java
===================================================================
--- branches/branch_5_1/src/com/mysql/jdbc/Blob.java 2008-02-15 21:30:33 UTC (rev 6733)
+++ branches/branch_5_1/src/com/mysql/jdbc/Blob.java 2008-02-20 17:13:12 UTC (rev 6734)
@@ -296,7 +296,7 @@
public synchronized void truncate(long len) throws SQLException {
checkClosed();
- if (len < 1) {
+ if (len < 0) {
throw SQLError.createSQLException("\"len\" argument can not be < 1.",
SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
}
Modified: branches/branch_5_1/src/testsuite/regression/BlobRegressionTest.java
===================================================================
--- branches/branch_5_1/src/testsuite/regression/BlobRegressionTest.java 2008-02-15
21:30:33 UTC (rev 6733)
+++ branches/branch_5_1/src/testsuite/regression/BlobRegressionTest.java 2008-02-20
17:13:12 UTC (rev 6734)
@@ -400,4 +400,20 @@
}
}
}
+
+ public void testBug34677() throws Exception {
+ createTable("testBug34677", "(field1 BLOB)");
+ this.stmt.executeUpdate("INSERT INTO testBug34677 VALUES ('abc')");
+
+ try {
+ this.rs = this.stmt.executeQuery("SELECT field1 FROM testBug34677");
+ this.rs.next();
+ Blob blob = this.rs.getBlob(1);
+ blob.truncate(0L);
+ assertEquals(0, blob.length());
+ assertEquals(-1, blob.getBinaryStream().read());
+ } finally {
+ closeMemberJDBCResources();
+ }
+ }
}
\ No newline at end of file
| Thread |
|---|
| • Connector/J commit: r6734 - in branches/branch_5_1: . src/com/mysql/jdbc src/testsuite/regression | mmatthews | 20 Feb |