db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r430825 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/loc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/m...
Date Fri, 11 Aug 2006 16:51:22 GMT
Author: davidvc
Date: Fri Aug 11 09:51:20 2006
New Revision: 430825

URL: http://svn.apache.org/viewvc?rev=430825&view=rev
Log:
DERBY-1516: Inconsistent behavior for getBytes and getSubString for 
embedded versus network.  Contributed by Craig Russell


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_en.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java

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=430825&r1=430824&r2=430825&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 Fri Aug 11 09:51:20 2006
@@ -125,8 +125,29 @@
         }
     }
 
-    // can return an array that may be have a length shorter than the supplied
-    // length (no padding occurs)
+  /**
+   * Returns as an array of bytes part or all of the <code>BLOB</code>
+   * value that this <code>Blob</code> object designates.  The byte
+   * array contains up to <code>length</code> consecutive bytes
+   * starting at position <code>pos</code>.
+   * The starting position must be between 1 and the length
+   * of the BLOB plus 1. This allows for zero-length BLOB values, from
+   * which only zero-length byte arrays can be returned. 
+   * If a larger length is requested than there are bytes available,
+   * characters from the start position to the end of the BLOB are returned.
+   * @param pos the ordinal position of the first byte in the
+   * <code>BLOB</code> value to be extracted; the first byte is at
+   * position 1
+   * @param length is the number of consecutive bytes to be copied
+   * @return a byte array containing up to <code>length</code>
+   * consecutive bytes from the <code>BLOB</code> value designated
+   * by this <code>Blob</code> object, starting with the
+   * byte at position <code>startPos</code>.
+   * @exception SQLException if there is an error accessing the
+   * <code>BLOB</code>
+   * NOTE: If the starting position is the length of the BLOB plus 1,
+   * zero bytess are returned regardless of the length requested.
+   */
     public byte[] getBytes(long pos, int length) throws SQLException {
         //call checkValidity to exit by throwing a SQLException if
         //the Blob object has been freed by calling free() on it
@@ -142,6 +163,11 @@
                         new ClientMessageId(SQLState.BLOB_BAD_POSITION), 
                         new Long(pos));
                 }
+                if (pos > this.length() + 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), 
+                        new Long(pos));
+                }
                 if (length < 0) {
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH),
@@ -163,14 +189,14 @@
     private byte[] getBytesX(long pos, int length) throws SqlException {
         checkForClosedConnection();
 
-        // we may need to check for overflow on this cast
         long actualLength;
         try {
+            // actual length is the lesser of the number of bytes requested
+            // and the number of bytes available from pos to the end
             actualLength = Math.min(this.length() - pos + 1, (long) length);
         } catch ( SQLException se ) {
             throw new SqlException(se);
         }
-
         byte[] retVal = new byte[(int) actualLength];
         System.arraycopy(binaryString_, (int) pos + dataOffset_ - 1, retVal, 0, (int) actualLength);
         return retVal;
@@ -225,6 +251,11 @@
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR));
                 }
+                if (start < 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_BAD_POSITION), 
+                            new Long(start));
+                }
                 long pos = positionX(pattern, start);
                 if (agent_.loggingEnabled()) {
                     agent_.logWriter_.traceExit(this, "position(byte[], long)", pos);
@@ -257,6 +288,11 @@
                 if (pattern == null) {
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR));
+                }
+                if (start < 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_BAD_POSITION), 
+                            new Long(start));
                 }
                 long pos = positionX(pattern, start);
                 if (agent_.loggingEnabled()) {

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=430825&r1=430824&r2=430825&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 Fri Aug 11 09:51:20 2006
@@ -229,6 +229,28 @@
         }
     }
 
+  /**
+   * Returns a copy of the specified substring
+   * in the <code>CLOB</code> value
+   * designated by this <code>Clob</code> object.
+   * The substring begins at position
+   * <code>pos</code> and has up to <code>length</code> consecutive
+   * characters. The starting position must be between 1 and the length
+   * of the CLOB plus 1. This allows for zero-length CLOB values, from
+   * which only zero-length substrings can be returned. 
+   * If a larger length is requested than there are characters available,
+   * characters to the end of the CLOB are returned.
+   * @param pos the first character of the substring to be extracted.
+   *            The first character is at position 1.
+   * @param length the number of consecutive characters to be copied
+   * @return a <code>String</code> that is the specified substring in
+   *         the <code>CLOB</code> value designated by this <code>Clob</code> object
+   * @exception SQLException if there is an error accessing the
+   * <code>CLOB</code>
+
+   * NOTE: If the starting position is the length of the CLOB plus 1,
+   * zero characters are returned regardless of the length requested.
+   */
     public String getSubString(long pos, int length) throws SQLException {
         
         //call checkValidity to exit by throwing a SQLException if
@@ -244,8 +266,6 @@
                     agent_.logWriter_.traceEntry(this, "getSubString", (int) pos, length);
                 }
 
-                // We can also do a check for pos > length()
-                // Defer it till FP7 so that proper testing can be performed on this
                 if ( pos <= 0 ) {
                     throw new SqlException(agent_.logWriter_,
                         new ClientMessageId(SQLState.BLOB_BAD_POSITION),
@@ -258,6 +278,11 @@
                         new Integer(length));
                 }
 
+                if (pos > this.length() + 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), 
+                        new Long(pos));                    
+                }
                 retVal = getSubStringX(pos, length);
 
                 if (agent_.loggingEnabled()) {
@@ -276,6 +301,8 @@
         try
         {
             checkForClosedConnection();
+            // actual length is the lesser of the length requested
+            // and the number of characters available from pos to the end
             long actualLength = Math.min(this.length() - pos + 1, (long) length);
             return string_.substring((int) pos - 1, (int) (pos - 1 + actualLength));
         }
@@ -378,6 +405,11 @@
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR));
                 }
+                if (start < 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_BAD_POSITION), 
+                            new Long(start));
+                }
 
                 long pos = positionX(searchstr, start);
                 if (agent_.loggingEnabled()) {
@@ -424,6 +456,12 @@
                             searchstr,
                             start);
                 }
+                if (start < 1) {
+                    throw new SqlException(agent_.logWriter_, 
+                        new ClientMessageId(SQLState.BLOB_BAD_POSITION), 
+                            new Long(start));
+                }
+
                 if (searchstr == null) {
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR));

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=430825&r1=430824&r2=430825&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 Fri Aug 11 09:51:20 2006
@@ -294,7 +294,12 @@
    * Returns as an array of bytes part or all of the <code>BLOB</code>
    * value that this <code>Blob</code> object designates.  The byte
    * array contains up to <code>length</code> consecutive bytes
-   * starting at position <code>pos</code>.
+   * starting at position <code>startPos</code>.
+   * The starting position must be between 1 and the length
+   * of the BLOB plus 1. This allows for zero-length BLOB values, from
+   * which only zero-length byte arrays can be returned. 
+   * If a larger length is requested than there are bytes available,
+   * characters from the start position to the end of the BLOB are returned.
    * @param startPos the ordinal position of the first byte in the
    * <code>BLOB</code> value to be extracted; the first byte is at
    * position 1
@@ -302,13 +307,12 @@
    * @return a byte array containing up to <code>length</code>
    * consecutive bytes from the <code>BLOB</code> value designated
    * by this <code>Blob</code> object, starting with the
-   * byte at position <code>pos</code>.
+   * byte at position <code>startPos</code>.
    * @exception SQLException if there is an error accessing the
    * <code>BLOB</code>
-   NOTE: return new byte[0] if startPos is too large
+   * NOTE: If the starting position is the length of the BLOB plus 1,
+   * zero bytess are returned regardless of the length requested.
    */
-   // PT stream part may get pushed to store
-
     public byte[] getBytes(long startPos, int length)
         throws SQLException
     {
@@ -322,7 +326,7 @@
             if (startPos < 1)
                 throw StandardException.newException(
                     SQLState.BLOB_BAD_POSITION, new Long(startPos));
-            if (length <= 0)
+            if (length < 0)
                 throw StandardException.newException(
                     SQLState.BLOB_NONPOSITIVE_LENGTH, new Integer(length));
 
@@ -330,8 +334,8 @@
             // if we have a byte array, not a stream
             if (isBytes)
             {
-                // if blob length is less than pos bytes, raise an exception
-                if (myBytes.length < startPos)
+                // if blob length is less than pos bytes + 1, raise an exception
+                if (myBytes.length + 1 < startPos)
                     throw StandardException.newException(
                         SQLState.BLOB_POSITION_TOO_LARGE, new Long(startPos));
                 // cannot go over length of array

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=430825&r1=430824&r2=430825&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 Fri Aug 11 09:51:20 2006
@@ -210,7 +210,11 @@
    * designated by this <code>Clob</code> object.
    * The substring begins at position
    * <code>pos</code> and has up to <code>length</code> consecutive
-   * characters.
+   * characters. The starting position must be between 1 and the length
+   * of the CLOB plus 1. This allows for zero-length CLOB values, from
+   * which only zero-length substrings can be returned. 
+   * If a larger length is requested than there are characters available,
+   * characters from the start position to the end of the CLOB are returned.
    * @param pos the first character of the substring to be extracted.
    *            The first character is at position 1.
    * @param length the number of consecutive characters to be copied
@@ -219,9 +223,9 @@
    * @exception SQLException if there is an error accessing the
    * <code>CLOB</code>
 
-   NOTE: return the empty string if pos is too large
+   * NOTE: If the starting position is the length of the CLOB plus 1,
+   * zero characters are returned regardless of the length requested.
    */
-
     public String getSubString(long pos, int length) throws SQLException
     {
         //call checkValidity to exit by throwing a SQLException if
@@ -231,7 +235,7 @@
         if (pos < 1)
             throw Util.generateCsSQLException(
                 SQLState.BLOB_BAD_POSITION, new Long(pos));
-        if (length <= 0)
+        if (length < 0)
             throw Util.generateCsSQLException(
                 SQLState.BLOB_NONPOSITIVE_LENGTH, new Integer(length));
 
@@ -239,11 +243,11 @@
         if (isString)
         {
             int sLength = myString.length();
-            if (sLength < pos)
+            if (sLength + 1 < pos)
                 throw Util.generateCsSQLException(
                     SQLState.BLOB_POSITION_TOO_LARGE, new Long(pos));
             int endIndex = ((int) pos) + length - 1;
-            // cannot go over length of string, or we get an exception
+            // cannot go over length of string
             return myString.substring(((int) pos) - 1, (sLength > endIndex ? endIndex : sLength));
         }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?rev=430825&r1=430824&r2=430825&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties Fri Aug 11 09:51:20 2006
@@ -1215,7 +1215,7 @@
 XJ069.S=No SetXXX methods allowed in case of USING execute statement.
 XJ074.S=Invalid parameter value ''{0}'' for Statement.setQueryTimeout(int seconds).
 XJ070.S=Negative or zero position argument ''{0}'' passed in a Blob or Clob method.
-XJ071.S=Zero or negative length argument ''{0}'' passed in a BLOB or CLOB method.
+XJ071.S=Negative length argument ''{0}'' passed in a BLOB or CLOB method.
 XJ072.S=Null pattern or searchStr passed in to a BLOB or CLOB position method.
 XJ073.S=The data in this BLOB or CLOB is no longer available.  The BLOB or CLOB's transaction may be committed, or its connection is closed.
 XJ076.S=The position argument ''{0}'' exceeds the size of the BLOB/CLOB.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out?rev=430825&r1=430824&r2=430825&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out Fri Aug 11 09:51:20 2006
@@ -87,12 +87,10 @@
 EXPECTED Out of bounds exception
 CLOB getSubString 68 > 0
 EXPECTED Out of bounds exception
-CLOB getSubString 1 > 0
 1(5) (len 50) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
-CLOB getSubString 1 > 0
 1(6) (len 1) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+1(7) (len 0) 
+1(8) (len 0) 
 CLOB getSubString 9905 > 65
 EXPECTED Out of bounds exception
 CLOB getSubString 5910 > 65
@@ -105,6 +103,8 @@
 EXPECTED Out of bounds exception
 2(5) (len 50) you can lead a horse to water but you can't form i
 2(6) (len 1) y
+2(7) (len 0) 
+2(8) (len 0) 
 CLOB getSubString 9905 > 26
 EXPECTED Out of bounds exception
 CLOB getSubString 5910 > 26
@@ -117,6 +117,8 @@
 EXPECTED Out of bounds exception
 3(5) (len 50) a stitch in time says ouch
 3(6) (len 1) a
+3(7) (len 0) 
+3(8) (len 0) 
 CLOB getSubString 9905 > 42
 EXPECTED Out of bounds exception
 CLOB getSubString 5910 > 42
@@ -130,6 +132,8 @@
 4(5) (len 50) here is a string with a return 
  character
 4(6) (len 1) h
+4(7) (len 0) 
+4(8) (len 0) 
 CLOB getSubString 9905 > 56
 EXPECTED Out of bounds exception
 CLOB getSubString 5910 > 56
@@ -142,6 +146,8 @@
 EXPECTED Out of bounds exception
 5(5) (len 50) test data: a string column inserted as an Ascii st
 5(6) (len 1) t
+5(7) (len 0) 
+5(8) (len 0) 
 6(0) (len 50) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) (len 150) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -151,7 +157,9 @@
 ine-we-are-now-on
 6(5) (len 50) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) (len 1) B
-6(7) 
+6(7) (len 0) 
+6(8) (len 0) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 CLOB getSubString 9905 > 0
 EXPECTED Out of bounds exception
@@ -163,12 +171,10 @@
 EXPECTED Out of bounds exception
 CLOB getSubString 68 > 0
 EXPECTED Out of bounds exception
-CLOB getSubString 1 > 0
 7(5) (len 50) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
-CLOB getSubString 1 > 0
 7(6) (len 1) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+7(7) (len 0) 
+7(8) (len 0) 
 CLOB getSubString 9905 > 5000
 EXPECTED Out of bounds exception
 CLOB getSubString 5910 > 5000
@@ -180,7 +186,9 @@
 wwwwwwwwwwwwwwwww
 8(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) (len 1) w
-8(7) 
+8(7) (len 0) 
+8(8) (len 0) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) (len 150) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -191,7 +199,9 @@
 wwwwwwwwwwwwwwwww
 9(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) (len 1) w
-9(7) 
+9(7) (len 0) 
+9(8) (len 0) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 clobTest2 finished
 START: clobTest22
@@ -454,10 +464,15 @@
 START: clobTest53
 clobTest53 finished
 START: clobTest54
+java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 EXPECTED SQLSTATE(22018): Invalid character string format for type INTEGER.
 end clobTest54
 START: clobTest6
- negative tests for clob.getSubstring won't run  for network server  until 5243 is fixed
+EXPECTED SQLSTATE(null): Invalid position 0 or length 5
+EXPECTED SQLSTATE(null): Invalid position 1 or length -76
+EXPECTED SQLSTATE(null): Invalid position 1 or length -1
+EXPECTED SQLSTATE(null): Invalid position 0 or length 0
+FAIL -- unexpected exception:java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 START: clobTest7
 clobTest7 finished
 START: clobTest8
@@ -574,70 +589,76 @@
 blobTest0 finished
 START: blobTest2
 testing Blob.getBytes() with pos 9905 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 0
-Known JCC Bug 5914
-testing Blob.getBytes() with pos 1 > 0
+FAIL: Caught exception java.lang.NegativeArraySizeException
 1(5) 
-FAIL testing Blob.getBytes() with pos 1 > 0
-testing Blob.getBytes() with pos 1 > 0
 1(6) 
-FAIL testing Blob.getBytes() with pos 1 > 0
+1(7) 
+1(8) 
 testing Blob.getBytes() with pos 9905 > 65
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 65
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 65
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 65
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 65
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 2(5) you can lead a horse to water but you can't form i
 2(6) y
+2(7) 
+2(8) 
 testing Blob.getBytes() with pos 9905 > 26
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 26
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 26
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 26
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 26
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 3(5) a stitch in time says ouch
 3(6) a
+3(7) 
+3(8) 
 testing Blob.getBytes() with pos 9905 > 42
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 42
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 42
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 42
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 42
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 4(5) here is a string with a return 
  character
 4(6) h
+4(7) 
+4(8) 
 testing Blob.getBytes() with pos 9905 > 56
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 56
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 56
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 56
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 56
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 5(5) test data: a string column inserted as an Ascii st
 5(6) t
+5(7) 
+5(8) 
 6(0) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -648,35 +669,37 @@
 6(5) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) B
 6(7) 
+6(8) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 testing Blob.getBytes() with pos 9905 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 204 > 0
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 68 > 0
-Known JCC Bug 5914
-testing Blob.getBytes() with pos 1 > 0
+FAIL: Caught exception java.lang.NegativeArraySizeException
 7(5) 
-FAIL testing Blob.getBytes() with pos 1 > 0
-testing Blob.getBytes() with pos 1 > 0
 7(6) 
-FAIL testing Blob.getBytes() with pos 1 > 0
+7(7) 
+7(8) 
 testing Blob.getBytes() with pos 9905 > 5000
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 5000
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 testing Blob.getBytes() with pos 5910 > 5000
-Known JCC Bug 5914
+FAIL: Caught exception java.lang.NegativeArraySizeException
 8(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwww
 8(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) w
 8(7) 
+8(8) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -688,6 +711,8 @@
 9(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) w
 9(7) 
+9(8) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 blobTest2 finished
 START: blobTest3
@@ -748,20 +773,20 @@
 blobTest53 finished
 START: blobTest54
 EXPECTED SQLSTATE(XCL12): An attempt was made to put a data value of type 'byte[]' into a data value of type 'INTEGER'.
+java.lang.NegativeArraySizeException
 blobTest54 finished
 START: blobTest6
 EXPECTED SQLSTATE(null): Invalid position 0 or length 5
 EXPECTED SQLSTATE(null): Invalid position 1 or length -76
-EXPECTED SQLSTATE(null): Search pattern cannot be null.
-EXPECTED SQLSTATE(null): Search pattern cannot be null.
-blobTest6 finished
+EXPECTED SQLSTATE(null): Invalid position 1 or length -1
+EXPECTED SQLSTATE(null): Invalid position 0 or length 0
+FAIL -- unexpected exception:java.lang.NegativeArraySizeException
 START: blobTest7
 blobTest7 finished
 START: blobTest8Trigger
-Row Count 0 Null Row 0
-Row Count 9 Null Row 1
-Row Count 9 Null Row 1
-blobTest8Trigger finished
+FAIL -- unexpected exception ****************
+SQLSTATE(X0X95): Operation 'CREATE TRIGGER' cannot be performed on object 'TESTBLOB' because there is an open ResultSet dependent on that object.
+com.ibm.db2.jcc.c.SqlException: Operation 'CREATE TRIGGER' cannot be performed on object 'TESTBLOB' because there is an open ResultSet dependent on that object.
 START: blobTest91
 done row 0, length was 0
 done row 1, length was 65

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out?rev=430825&r1=430824&r2=430825&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out Fri Aug 11 09:51:20 2006
@@ -78,70 +78,76 @@
 clobTest13Trigger finished
 START: clobTest2
 CLOB getSubString 9905 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 0
-EXPECTED Out of bounds exception
-CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 1(5) (len 50) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
-CLOB getSubString 1 > 0
 1(6) (len 1) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+1(7) (len 0) 
+1(8) (len 0) 
 CLOB getSubString 9905 > 65
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 65
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 65
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 65
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 65
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 2(5) (len 50) you can lead a horse to water but you can't form i
 2(6) (len 1) y
+2(7) (len 0) 
+2(8) (len 0) 
 CLOB getSubString 9905 > 26
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 26
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 26
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 26
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 26
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 3(5) (len 50) a stitch in time says ouch
 3(6) (len 1) a
+3(7) (len 0) 
+3(8) (len 0) 
 CLOB getSubString 9905 > 42
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 42
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 42
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 42
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 42
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 4(5) (len 50) here is a string with a return 
  character
 4(6) (len 1) h
+4(7) (len 0) 
+4(8) (len 0) 
 CLOB getSubString 9905 > 56
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 56
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 56
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 56
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 56
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 5(5) (len 50) test data: a string column inserted as an Ascii st
 5(6) (len 1) t
+5(7) (len 0) 
+5(8) (len 0) 
 6(0) (len 50) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) (len 150) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -151,36 +157,38 @@
 ine-we-are-now-on
 6(5) (len 50) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) (len 1) B
-6(7) 
+6(7) (len 0) 
+6(8) (len 0) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 CLOB getSubString 9905 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 204 > 0
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 0
-EXPECTED Out of bounds exception
-CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 7(5) (len 50) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
-CLOB getSubString 1 > 0
 7(6) (len 1) 
-CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+7(7) (len 0) 
+7(8) (len 0) 
 CLOB getSubString 9905 > 5000
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 5000
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 5000
-EXPECTED Out of bounds exception
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 8(3) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(4) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwww
 8(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) (len 1) w
-8(7) 
+8(7) (len 0) 
+8(8) (len 0) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) (len 150) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -191,7 +199,9 @@
 wwwwwwwwwwwwwwwww
 9(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) (len 1) w
-9(7) 
+9(7) (len 0) 
+9(8) (len 0) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 clobTest2 finished
 START: clobTest22
@@ -457,7 +467,16 @@
 EXPECTED SQLSTATE(22018): Invalid character string format for type INTEGER.
 end clobTest54
 START: clobTest6
- negative tests for clob.getSubstring won't run  for network server  until 5243 is fixed
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-76' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-1' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ076): The position argument '2' exceeds the size of the BLOB/CLOB.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
+clobTest6 finished
 START: clobTest7
 clobTest7 finished
 START: clobTest8
@@ -574,70 +593,76 @@
 blobTest0 finished
 START: blobTest2
 testing Blob.getBytes() with pos 9905 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 0
-Known JCC Bug 5914
-testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 1(5) 
-FAIL testing Blob.getBytes() with pos 1 > 0
-testing Blob.getBytes() with pos 1 > 0
 1(6) 
-FAIL testing Blob.getBytes() with pos 1 > 0
+1(7) 
+1(8) 
 testing Blob.getBytes() with pos 9905 > 65
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 65
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 65
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 65
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 65
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 2(5) you can lead a horse to water but you can't form i
 2(6) y
+2(7) 
+2(8) 
 testing Blob.getBytes() with pos 9905 > 26
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 26
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 26
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 26
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 26
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 3(5) a stitch in time says ouch
 3(6) a
+3(7) 
+3(8) 
 testing Blob.getBytes() with pos 9905 > 42
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 42
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 42
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 42
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 42
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 4(5) here is a string with a return 
  character
 4(6) h
+4(7) 
+4(8) 
 testing Blob.getBytes() with pos 9905 > 56
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 56
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 56
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 56
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 56
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 5(5) test data: a string column inserted as an Ascii st
 5(6) t
+5(7) 
+5(8) 
 6(0) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -648,35 +673,37 @@
 6(5) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) B
 6(7) 
+6(8) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 testing Blob.getBytes() with pos 9905 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 204 > 0
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 0
-Known JCC Bug 5914
-testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 7(5) 
-FAIL testing Blob.getBytes() with pos 1 > 0
-testing Blob.getBytes() with pos 1 > 0
 7(6) 
-FAIL testing Blob.getBytes() with pos 1 > 0
+7(7) 
+7(8) 
 testing Blob.getBytes() with pos 9905 > 5000
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 5000
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 5000
-Known JCC Bug 5914
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the BLOB/CLOB.
 8(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwww
 8(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) w
 8(7) 
+8(8) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -688,6 +715,8 @@
 9(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) w
 9(7) 
+9(8) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 blobTest2 finished
 START: blobTest3
@@ -750,8 +779,13 @@
 blobTest54 finished
 START: blobTest6
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
-EXPECTED SQLSTATE(XJ071): Zero or negative length argument '-76' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-76' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-1' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ076): The position argument '2' exceeds the size of the BLOB/CLOB.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
 EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.
 EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
 blobTest6 finished
 START: blobTest7

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out?rev=430825&r1=430824&r2=430825&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out Fri Aug 11 09:51:20 2006
@@ -87,10 +87,10 @@
 EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
-CLOB getSubString 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
-CLOB getSubString 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
+1(5) (len 50) 
+1(6) (len 1) 
+1(7) (len 0) 
+1(8) (len 0) 
 CLOB getSubString 9905 > 65
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 65
@@ -103,6 +103,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 2(5) (len 50) you can lead a horse to water but you can't form i
 2(6) (len 1) y
+2(7) (len 0) 
+2(8) (len 0) 
 CLOB getSubString 9905 > 26
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 26
@@ -115,6 +117,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 3(5) (len 50) a stitch in time says ouch
 3(6) (len 1) a
+3(7) (len 0) 
+3(8) (len 0) 
 CLOB getSubString 9905 > 42
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 42
@@ -128,6 +132,8 @@
 4(5) (len 50) here is a string with a return 
  character
 4(6) (len 1) h
+4(7) (len 0) 
+4(8) (len 0) 
 CLOB getSubString 9905 > 56
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 56
@@ -140,6 +146,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 5(5) (len 50) test data: a string column inserted as an Ascii st
 5(6) (len 1) t
+5(7) (len 0) 
+5(8) (len 0) 
 6(0) (len 50) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) (len 150) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -149,7 +157,9 @@
 ine-we-are-now-on
 6(5) (len 50) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) (len 1) B
-6(7) 
+6(7) (len 0) 
+6(8) (len 0) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 CLOB getSubString 9905 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
@@ -161,10 +171,10 @@
 EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 68 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
-CLOB getSubString 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
-CLOB getSubString 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
+7(5) (len 50) 
+7(6) (len 1) 
+7(7) (len 0) 
+7(8) (len 0) 
 CLOB getSubString 9905 > 5000
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 CLOB getSubString 5910 > 5000
@@ -176,7 +186,9 @@
 wwwwwwwwwwwwwwwww
 8(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) (len 1) w
-8(7) 
+8(7) (len 0) 
+8(8) (len 0) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) (len 150) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -187,7 +199,9 @@
 wwwwwwwwwwwwwwwww
 9(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) (len 1) w
-9(7) 
+9(7) (len 0) 
+9(8) (len 0) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 clobTest2 finished
 START: clobTest22
@@ -455,8 +469,10 @@
 end clobTest54
 START: clobTest6
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
-EXPECTED SQLSTATE(XJ071): Zero or negative length argument '-76' passed in a BLOB or CLOB method.
-EXPECTED SQLSTATE(XJ071): Zero or negative length argument '0' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-76' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-1' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ076): The position argument '2' exceeds the size of the BLOB/CLOB.
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
 EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.
@@ -603,10 +619,10 @@
 EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
-testing Blob.getBytes() with pos 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
-testing Blob.getBytes() with pos 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
+1(5) 
+1(6) 
+1(7) 
+1(8) 
 testing Blob.getBytes() with pos 9905 > 65
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 65
@@ -619,6 +635,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 2(5) you can lead a horse to water but you can't form i
 2(6) y
+2(7) 
+2(8) 
 testing Blob.getBytes() with pos 9905 > 26
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 26
@@ -631,6 +649,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 3(5) a stitch in time says ouch
 3(6) a
+3(7) 
+3(8) 
 testing Blob.getBytes() with pos 9905 > 42
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 42
@@ -644,6 +664,8 @@
 4(5) here is a string with a return 
  character
 4(6) h
+4(7) 
+4(8) 
 testing Blob.getBytes() with pos 9905 > 56
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 56
@@ -656,6 +678,8 @@
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
 5(5) test data: a string column inserted as an Ascii st
 5(6) t
+5(7) 
+5(8) 
 6(0) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
 6(1) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -666,6 +690,8 @@
 6(5) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 6(6) B
 6(7) 
+6(8) 
+6(9) 
 wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 testing Blob.getBytes() with pos 9905 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
@@ -677,10 +703,10 @@
 EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 68 > 0
 EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the BLOB/CLOB.
-testing Blob.getBytes() with pos 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
-testing Blob.getBytes() with pos 1 > 0
-EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the BLOB/CLOB.
+7(5) 
+7(6) 
+7(7) 
+7(8) 
 testing Blob.getBytes() with pos 9905 > 5000
 EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the BLOB/CLOB.
 testing Blob.getBytes() with pos 5910 > 5000
@@ -693,6 +719,8 @@
 8(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 8(6) w
 8(7) 
+8(8) 
+8(9) 
 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(0) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(1) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
@@ -704,6 +732,8 @@
 9(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 9(6) w
 9(7) 
+9(8) 
+9(9) 
 wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 blobTest2 finished
 START: blobTest3
@@ -725,63 +755,31 @@
  in row 8 starting from position 1 at position 100
 blobTest3 finished
 START: blobTest4
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found horse in row 2 at position 16
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found ouch in row 3 at position 23
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found 
  in row 4 at position 32
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found 
  in row 5 at position 56
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 Found test data: a string column inserted as an Ascii stream
  in row 5 at position 1
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found 
  in row 6 at position 100
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 Found Beginning in row 6 at position 1
 Found position-69 in row 6 at position 69
 Found I-am-hiding-here-at-position-5910 in row 6 at position 5910
 Found Position-9907 in row 6 at position 9907
 Found blob (row 10)  in row 6 at position 1
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 Found blob (row 12)  in row 6 at position 301
 searchBlob row 13 skipped (too large)
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 searchBlob row 13 skipped (too large)
 Found 
  in row 8 at position 100
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
-FAIL -- unexpected exception ****************
-SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 Found blob (row 12)  in row 8 at position 1
 searchBlob row 13 skipped (too large)
 testBlob row 9 skipped (too large)
@@ -798,8 +796,10 @@
 blobTest54 finished
 START: blobTest6
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
-EXPECTED SQLSTATE(XJ071): Zero or negative length argument '-76' passed in a BLOB or CLOB method.
-EXPECTED SQLSTATE(XJ071): Zero or negative length argument '0' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-76' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ071): Negative length argument '-1' passed in a BLOB or CLOB method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ076): The position argument '2' exceeds the size of the BLOB/CLOB.
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
 EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a BLOB or CLOB position method.
 EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?rev=430825&r1=430824&r2=430825&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java Fri Aug 11 09:51:20 2006
@@ -922,6 +922,10 @@
                 blobclob4BLOB.printInterval(clob, 68, 50, 4, i, clobLength);
                 blobclob4BLOB.printInterval(clob, 1, 50, 5, i, clobLength);
                 blobclob4BLOB.printInterval(clob, 1, 1, 6, i, clobLength);
+                blobclob4BLOB.printInterval(
+                        clob, 1, 0, 7, i, clobLength); // length 0 at start
+                blobclob4BLOB.printInterval(
+                        clob, clobLength + 1, 0, 8, i, clobLength); // and end
                 /*
                 System.out.println(i + "(0) " + clob.getSubString(9905,50));
                 System.out.println(i + "(1) " + clob.getSubString(5910,150));
@@ -934,7 +938,7 @@
                 if (clobLength > 100)
                 {
                     String res = clob.getSubString(clobLength-99,200);
-                    System.out.println(i + "(7) ");
+                    System.out.println(i + "(9) ");
                     if (res.length() != 100)
                         System.out.println("FAIL : length of substring is " +
                             res.length() + " should be 100");
@@ -1470,11 +1474,6 @@
 
             
             // 0 or negative position value
-			if (isDerbyNet)
-				System.out.println(" negative tests for clob.getSubstring won't run  for network server  until 5243 is fixed");
-			if (! isDerbyNet)
-			{
-
 				try
 				{
 					clob.getSubString(0,5);
@@ -1497,16 +1496,30 @@
             {
                 TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
             }
-            // zero length value
+            // boundary negative 1 length
+            try {
+                clob.getSubString(1,-1);
+                System.out.println("FAIL = getSubString(1,-1)");
+            } catch (SQLException e) {
+                 TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+             }
+            // before start with length zero
             try
             {
-                clob.getSubString(1,0);
- 				System.out.println("FAIL = getSubString(1,0)");
+                clob.getSubString(0,0);
+ 				System.out.println("FAIL = getSubString(0,0)");
            }
             catch (SQLException e)
             {
                 TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
             }
+            // 2 past end with length 0
+            try {
+                clob.getSubString(clobLength + 2,0);
+                System.out.println("FAIL = getSubString(clobLength + 2,0)");
+            }  catch (SQLException e) {
+                TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+            }
             // 0 or negative position value
             try
             {
@@ -1548,7 +1561,6 @@
                 TestUtil.dumpSQLExceptions(e, "XJ072".equals(e.getSQLState()));
             }
             System.out.println("clobTest6 finished");
-			}
         }
 		catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
@@ -3264,6 +3276,10 @@
                 blobclob4BLOB.printInterval(blob, 68, 50, 4, i, blobLength);
                 blobclob4BLOB.printInterval(blob, 1, 50, 5, i, blobLength);
                 blobclob4BLOB.printInterval(blob, 1, 1, 6, i, blobLength);
+                blobclob4BLOB.printInterval(
+                        blob, 1, 0, 7, i, blobLength); // length 0 at start
+                blobclob4BLOB.printInterval(
+                        blob, blobLength + 1, 0, 8, i, blobLength); // and end
                 /*
                 System.out.println(i + "(0) " + new String(blob.getBytes(9905,50), "US-ASCII"));
                 System.out.println(i + "(1) " + new String(blob.getBytes(5910,150), "US-ASCII"));
@@ -3276,7 +3292,7 @@
                 if (blobLength > 100)
                 {
                     byte[] res = blob.getBytes(blobLength-99,200);
-                    System.out.println(i + "(7) ");
+                    System.out.println(i + "(9) ");
                     if (res.length != 100)
                         System.out.println("FAIL : length of bytes is " +
                             res.length + " should be 100");
@@ -3745,12 +3761,24 @@
                 // zero length value
                 try
                 {
-                    blob.getBytes(1,0);
+                    blob.getBytes(1,-1);
                 }
         		catch (SQLException e)
                 {
 			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
 		        }
+                // before begin length 0
+                try {
+                    blob.getBytes(0,0);
+                } catch (SQLException e) {
+                    TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+                }
+                // after end length 0
+                try {
+                    blob.getBytes(blobLength + 2,0);
+                } catch (SQLException e) {
+                    TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+                }
                 // 0 or negative position value
                 try
                 {
@@ -4616,7 +4644,7 @@
     static void printInterval(Clob clob, long pos, int length,
         int testNum, int iteration, int clobLength)
     {
-		if (pos > clobLength)
+		if (pos > clobLength + 1)
 			System.out.println("CLOB getSubString " + pos + " > " + clobLength);
         try
         {
@@ -4635,7 +4663,7 @@
 			if (l1 != clobLength) {
 				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + clobLength);
 			}
-			if (pos > clobLength)
+			if (pos > clobLength + 1)
 				System.out.println("CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE " + pos + " > " + clobLength);
 
 
@@ -4646,7 +4674,7 @@
 			boolean expected = false;
 
 
-			if (pos < 1 || pos > clobLength)
+			if (pos < 1 || pos > clobLength + 1)
 			{
 				if (isOutOfBoundException(e))
 					expected = true;
@@ -4680,7 +4708,7 @@
     static void printInterval(Blob blob, long pos, int length,
         int testNum, int iteration, long blobLength)
     {
-		if (pos > blobLength)
+		if (pos > blobLength + 1)
 			System.out.println("testing Blob.getBytes() with pos " + pos + " > " + blobLength);
         try
         {
@@ -4693,7 +4721,7 @@
 			if (l1 != blobLength) {
 				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + blobLength);
 			}
-			if (pos > blobLength)
+			if (pos > blobLength + 1)
 				System.out.println("FAIL testing Blob.getBytes() with pos " + pos + " > " + blobLength);
         }
 		catch (SQLException e)
@@ -4701,15 +4729,15 @@
 			String state = e.getSQLState();
 			boolean expected = false;
 
-			if (pos < 1 || pos > blobLength)
+			if (pos < 1 || pos > blobLength + 1)
 				expected = isOutOfBoundException(e);
 
 			TestUtil.dumpSQLExceptions(e, expected);
 		}
 		catch (Exception e)
 		{
-			if ((pos > blobLength) && isDerbyNet)
-				System.out.println("Known JCC Bug 5914");
+			System.out.println("FAIL: Caught exception " + 
+                                e.toString());
 		}
     }
     static void printPosition(



Mime
View raw message