Description
org.apache.derby.client.am.Clob.getSubString(pos, length) and org.apache.derby.client.am.Blob.getBytes(pos, length) check the length for less than zero.
if ((pos <= 0) || (length < 0)) {
throw new SqlException(agent_.logWriter_, "Invalid position " + pos + " or length " + length);
But org.apache.derby.impl.jdbc.EmbedClob(pos, length) and org.apache.derby.impl.jdbc.EmbedBlob(pos, length) check the length for less than or equal to zero.
if (length <= 0)
throw Util.generateCsSQLException(
SQLState.BLOB_NONPOSITIVE_LENGTH, new Integer(length));
The specification does not disallow length of zero, so zero length should be allowed. I believe that the implementation in org.apache.derby.client.am is correct, and the implementation in org.apache.derby.impl.jdbc is incorrect.
Attachments
Attachments
Issue Links
- is part of
-
DERBY-310 Document and/or change Derby client code to match behavior with Embedded driver where possible.
- Closed
- is related to
-
DERBY-1691 jdbcapi/blobclob4BLOB.java fails under DerbyNet framework with JCC 2.6
- Closed
-
DERBY-1615 Rewrite the Clob implementation in the client driver
- Closed