Author: kristwaa
Date: Mon Dec 15 05:47:59 2008
New Revision: 726695
URL: http://svn.apache.org/viewvc?rev=726695&view=rev
Log:
DERBY-3977: Clob.truncate with a value greater than the Clob length raises different exceptions
in embedded and client driver.
Changed the exception thrown in the embedded driver when calling Clob.truncate with a length
greater than the Clob length from XJ076 to XJ079 (see also release note).
The client and the embedded driver behavior is now consistent.
Updated tests.
Patch file: derby-3977-1a-change_emb_exception.diff
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java?rev=726695&r1=726694&r2=726695&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java Mon Dec 15 05:47:59
2008
@@ -639,8 +639,8 @@
}
catch (EOFException eofe) {
throw Util.generateCsSQLException(
- SQLState.BLOB_POSITION_TOO_LARGE,
- new Long(len));
+ SQLState.BLOB_LENGTH_TOO_LONG,
+ new Long(len), eofe);
} catch (IOException e) {
throw Util.setStreamFailure(e);
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java?rev=726695&r1=726694&r2=726695&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java
Mon Dec 15 05:47:59 2008
@@ -424,12 +424,7 @@
this.clob.truncate(size * 2);
fail("Truncate should have failed, position too large");
} catch (SQLException sqle) {
- // See DERBY-3977
- if (usingEmbedded()) {
- assertSQLState("XJ076", sqle);
- } else {
- assertSQLState("XJ079", sqle);
- }
+ assertSQLState("XJ079", sqle);
}
}
@@ -446,12 +441,7 @@
this.clob.truncate(size * 2);
fail("Truncate should have failed, position too large");
} catch (SQLException sqle) {
- // See DERBY-3977
- if (usingEmbedded()) {
- assertSQLState("XJ076", sqle);
- } else {
- assertSQLState("XJ079", sqle);
- }
+ assertSQLState("XJ079", sqle);
}
}
|