[ http://issues.apache.org/jira/browse/DERBY-1516?page=comments#action_12427263 ] David Van Couvering commented on DERBY-1516: --------------------------------------------
Hi, Craig. I merged your patch into my sandbox and ran derbyall, and I'm sorry to say I had a test failure. derbynetmats/DerbyNet/jdbcapi/blobclob4BLOB is the test, I think you just didn't run this under the DerbyNet framework (which is the IBM JDBC driver). Here are the diffs. If you think these look good I can go ahead and update the master file. However, I am concerned about the "open result set" error at the end of the diff... ********* Diff file derbyall/derbynetmats/DerbyNet/jdbcapi/blobclob4BLOB.diff *** Start: blobclob4BLOB jdk1.5.0_06 DerbyNet derbynetmats:jdbcapi 2006-08-09 18:04:28 *** 90d89 < CLOB getSubString 1 > 0 92,93d90 < CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0 < CLOB getSubString 1 > 0 95 del < CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0 95a92,93 > 1(7) (len 0) > 1(8) (len 0) 107a106,107 > 2(7) (len 0) > 2(8) (len 0) 119a120,121 > 3(7) (len 0) > 3(8) (len 0) 132a135,136 > 4(7) (len 0) > 4(8) (len 0) 144a149,150 > 5(7) (len 0) > 5(8) (len 0) 154 del < 6(7) 154a160,162 > 6(7) (len 0) > 6(8) (len 0) > 6(9) 166d173 < CLOB getSubString 1 > 0 168,169d174 < CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0 < CLOB getSubString 1 > 0 171 del < CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0 171a176,177 > 7(7) (len 0) > 7(8) (len 0) 183 del < 8(7) 183a189,191 > 8(7) (len 0) > 8(8) (len 0) > 8(9) 194 del < 9(7) 194a202,204 > 9(7) (len 0) > 9(8) (len 0) > 9(9) 456a467 > java.lang.StringIndexOutOfBoundsException: String index out of range: -1 460 del < negative tests for clob.getSubstring won't run for network server until 5243 is fixed 460a471,475 > 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 577 del < Known JCC Bug 5914 577a592 > FAIL: Caught exception java.lang.NegativeArraySizeException 579 del < Known JCC Bug 5914 579a594 > FAIL: Caught exception java.lang.NegativeArraySizeException 581 del < Known JCC Bug 5914 581a596 > FAIL: Caught exception java.lang.NegativeArraySizeException 583 del < Known JCC Bug 5914 583a598 > FAIL: Caught exception java.lang.NegativeArraySizeException 585 del < Known JCC Bug 5914 586 del < testing Blob.getBytes() with pos 1 > 0 586a600 > FAIL: Caught exception java.lang.NegativeArraySizeException 588,589d601 < FAIL testing Blob.getBytes() with pos 1 > 0 < testing Blob.getBytes() with pos 1 > 0 591 del < FAIL testing Blob.getBytes() with pos 1 > 0 591a603,604 > 1(7) > 1(8) 593 del < Known JCC Bug 5914 593a606 > FAIL: Caught exception java.lang.NegativeArraySizeException 595 del < Known JCC Bug 5914 595a608 > FAIL: Caught exception java.lang.NegativeArraySizeException 597 del < Known JCC Bug 5914 597a610 > FAIL: Caught exception java.lang.NegativeArraySizeException 599 del < Known JCC Bug 5914 599a612 > FAIL: Caught exception java.lang.NegativeArraySizeException 601 del < Known JCC Bug 5914 601a614 > FAIL: Caught exception java.lang.NegativeArraySizeException 603a617,618 > 2(7) > 2(8) 605 del < Known JCC Bug 5914 605a620 > FAIL: Caught exception java.lang.NegativeArraySizeException 607 del < Known JCC Bug 5914 607a622 > FAIL: Caught exception java.lang.NegativeArraySizeException 609 del < Known JCC Bug 5914 609a624 > FAIL: Caught exception java.lang.NegativeArraySizeException 611 del < Known JCC Bug 5914 611a626 > FAIL: Caught exception java.lang.NegativeArraySizeException 613 del < Known JCC Bug 5914 613a628 > FAIL: Caught exception java.lang.NegativeArraySizeException 615a631,632 > 3(7) > 3(8) 617 del < Known JCC Bug 5914 617a634 > FAIL: Caught exception java.lang.NegativeArraySizeException 619 del < Known JCC Bug 5914 619a636 > FAIL: Caught exception java.lang.NegativeArraySizeException 621 del < Known JCC Bug 5914 621a638 > FAIL: Caught exception java.lang.NegativeArraySizeException 623 del < Known JCC Bug 5914 623a640 > FAIL: Caught exception java.lang.NegativeArraySizeException 625 del < Known JCC Bug 5914 625a642 > FAIL: Caught exception java.lang.NegativeArraySizeException 628a646,647 > 4(7) > 4(8) 630 del < Known JCC Bug 5914 630a649 > FAIL: Caught exception java.lang.NegativeArraySizeException 632 del < Known JCC Bug 5914 632a651 > FAIL: Caught exception java.lang.NegativeArraySizeException 634 del < Known JCC Bug 5914 634a653 > FAIL: Caught exception java.lang.NegativeArraySizeException 636 del < Known JCC Bug 5914 636a655 > FAIL: Caught exception java.lang.NegativeArraySizeException 638 del < Known JCC Bug 5914 638a657 > FAIL: Caught exception java.lang.NegativeArraySizeException 640a660,661 > 5(7) > 5(8) 650a672,673 > 6(8) > 6(9) 653 del < Known JCC Bug 5914 653a676 > FAIL: Caught exception java.lang.NegativeArraySizeException 655 del < Known JCC Bug 5914 655a678 > FAIL: Caught exception java.lang.NegativeArraySizeException 657 del < Known JCC Bug 5914 657a680 > FAIL: Caught exception java.lang.NegativeArraySizeException 659 del < Known JCC Bug 5914 659a682 > FAIL: Caught exception java.lang.NegativeArraySizeException 661 del < Known JCC Bug 5914 662 del < testing Blob.getBytes() with pos 1 > 0 662a684 > FAIL: Caught exception java.lang.NegativeArraySizeException 664,665d685 < FAIL testing Blob.getBytes() with pos 1 > 0 < testing Blob.getBytes() with pos 1 > 0 667 del < FAIL testing Blob.getBytes() with pos 1 > 0 667a687,688 > 7(7) > 7(8) 669 del < Known JCC Bug 5914 669a690 > FAIL: Caught exception java.lang.NegativeArraySizeException 671 del < Known JCC Bug 5914 671a692 > FAIL: Caught exception java.lang.NegativeArraySizeException 673 del < Known JCC Bug 5914 673a694 > FAIL: Caught exception java.lang.NegativeArraySizeException 679a701,702 > 8(8) > 8(9) 690a714,715 > 9(8) > 9(9) 741a767 > java.lang.NegativeArraySizeException 755 del < EXPECTED SQLSTATE(null): Search pattern cannot be null. 756 del < EXPECTED SQLSTATE(null): Search pattern cannot be null. 757 del < blobTest6 finished 757a781,783 > EXPECTED SQLSTATE(null): Invalid position 1 or length -1 > EXPECTED SQLSTATE(null): Invalid position 0 or length 0 > FAIL -- unexpected exception:java.lang.NegativeArraySizeException 761 del < Row Count 0 Null Row 0 762 del < Row Count 9 Null Row 1 763 del < Row Count 9 Null Row 1 764 del < blobTest8Trigger finished 764a787,789 > 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. Test Failed. > Inconsistent behavior for getBytes and getSubString for embedded versus > network > ------------------------------------------------------------------------------- > > Key: DERBY-1516 > URL: http://issues.apache.org/jira/browse/DERBY-1516 > Project: Derby > Issue Type: Bug > Components: JDBC > Reporter: Craig Russell > Assigned To: Craig Russell > Priority: Minor > Attachments: DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, > DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch > > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira