You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2009/03/09 10:44:44 UTC
svn commit: r751637 - in /db/derby/code/trunk/java:
client/org/apache/derby/client/am/ engine/org/apache/derby/impl/jdbc/
engine/org/apache/derby/loc/
Author: kristwaa
Date: Mon Mar 9 09:44:44 2009
New Revision: 751637
URL: http://svn.apache.org/viewvc?rev=751637&view=rev
Log:
DERBY-4060: Blob.getBinaryStream(long,long) is off by one for the pos+len check.
Changes to the JavaDoc and one error message, to better describe the error situation.
Patch file: derby-4060-2a-doc_changes.diff
Modified:
db/derby/code/trunk/java/client/org/apache/derby/client/am/Blob.java
db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Blob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Blob.java?rev=751637&r1=751636&r2=751637&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Blob.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Blob.java Mon Mar 9 09:44:44 2009
@@ -644,8 +644,8 @@
* @return <code>InputStream</code> through which the partial
* <code>Blob</code> value can be read.
* @throws SQLException if pos is less than 1 or if pos is greater than
- * the number of bytes in the <code>Blob</code> or if pos + length is
- * greater than the number of bytes in the <code>Blob</code>
+ * the number of bytes in the {@code Blob} or if {@code pos + length} is
+ * greater than {@code Blob.length() +1}
*/
public InputStream getBinaryStream(long pos, long length)
throws SQLException {
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java?rev=751637&r1=751636&r2=751637&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java Mon Mar 9 09:44:44 2009
@@ -875,9 +875,8 @@
* value can be read.
* @throws SQLException if pos is less than 1 or if pos is greater than the
* number of
- * characters in the <code>Clob</code> or if pos + length is greater than
- * the number of
- * characters in the <code>Clob</code>
+ * characters in the {@code Clob} or if {@code pos + length} is greater than
+ * {@code Clob.length() +1}
*/
public Reader getCharacterStream(long pos, long length)
throws SQLException {
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java?rev=751637&r1=751636&r2=751637&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java Mon Mar 9 09:44:44 2009
@@ -977,8 +977,8 @@
* @param length the length in bytes of the partial value to be retrieved
* @return through which the partial <code>Blob</code> value can be read.
* @throws SQLException if pos is less than 1 or if pos is greater than
- * the number of bytes in the <code>Blob</code> or if pos + length is
- * greater than the number of bytes in the <code>Blob</code>
+ * the number of bytes in the {@code Blob} or if {@code pos + length}
+ * is greater than {@code Blob.length() +1}
*/
public InputStream getBinaryStream(long pos, long length)
throws SQLException {
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=751637&r1=751636&r2=751637&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 Mar 9 09:44:44 2009
@@ -685,11 +685,8 @@
* value can be read.
* @throws SQLException if pos is less than 1 or if pos is greater than the
* number of
- * characters in the <code>Clob</code> or if pos + length is greater than
- * the number of
- * characters in the <code>Clob</code>
- *
- * @throws SQLException.
+ * characters in the {@code Clob} or if {@code pos + length} is greater than
+ * {@code Clob.length() +1}
*/
public java.io.Reader getCharacterStream(long pos, long length)
throws SQLException {
Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=751637&r1=751636&r2=751637&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Mon Mar 9 09:44:44 2009
@@ -4483,7 +4483,7 @@
<msg>
<name>XJ087.S</name>
- <text>Sum of position('{0}') and length('{1}') is greater than the size of the LOB.</text>
+ <text>Sum of position('{0}') and length('{1}') is greater than the size of the LOB plus one.</text>
<arg>pos</arg>
<arg>length</arg>
</msg>