You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Suran Jayathilaka (JIRA)" <ji...@apache.org> on 2008/06/03 20:58:45 UTC

[jira] Created: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-3705
                 URL: https://issues.apache.org/jira/browse/DERBY-3705
             Project: Derby
          Issue Type: Bug
          Components: Network Client
    Affects Versions: 10.4.1.3
         Environment: Windows XP SP2, Derby trunk SVN checkout
            Reporter: Suran Jayathilaka
            Priority: Critical


This is related to Cloudscape bug 4250.

Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.

e.g. //from store/StreamingColumn
PreparedStatement ps = prepareStatement("insert into "
				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
		ps.setInt(1, 100);
		try {
			println("===> testing using setAsciiStream with -2 as length");
			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
                 }


This issue has been fixed for embedded mode, but not for client mode.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka resolved DERBY-3705.
--------------------------------------

    Resolution: Fixed

Patch committed.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3705-2.diff, derby-3705-2b.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3705:
-----------------------------------

             Priority: Minor  (was: Critical)
    Affects Version/s: 10.5.0.0

Good catch Suran :)
Nice work on converting the big test.

I''m changing the priority from critical to minor (press the yellow question mark next to the priority field to see descriptions of the various levels). There is a simple workaround available; don't specify negative stream lengths.
It would be interesting to know what happens if you do specify a negative length though, and if that causes data corruption the priority would have to be raised again.

I'll happily review your patch tomorrow.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603868#action_12603868 ] 

kristwaa edited comment on DERBY-3705 at 6/10/08 8:45 AM:
-----------------------------------------------------------------

Thank you Suran.
I'm running the tests again and intend to commit the patch as soon as they have completed.

I took the liberty to replace a few tabs in the patch, and changed some formatting in the new method to stay below 80 characters per line. Attached modified patch as 'derby-3705-2b.diff'.

      was (Author: kristwaa):
    Thank you Suran.
I'm running the tests again and intend to commit the patch as soon as they have completed.

I took the liberty to replace a few tabs in the patch, and changed some formatting in the new method to stay below 80 lines. Attached modified patch as 'derby-3705-2b.diff'.
  
> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705-2.diff, derby-3705-2b.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602564#action_12602564 ] 

Kristian Waagan commented on DERBY-3705:
----------------------------------------

The patch looks good to me, and is basically ready for commit.
We do try to keep lines under 80 characters long, so you might want to reformat the lines that are longer than that.

I also assume the regression test for this issue will be found in the test you are working on converting?

As an extra step later on, one could also refactor the client code and create a method that checks the maximum and minimum length. Currently the code is duplicated in a number of methods.
I also notice that there is a try-catch for SqlException, but that 'throw new SqlException(...).getSQLException()' is used within. It would be good to either get rid of the try-catch blocks or not use the getSQLException method.

I have started the regression tests and will report back when they are done.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3705:
-----------------------------------

    Attachment: derby-3705-2b.diff

Thank you Suran.
I'm running the tests again and intend to commit the patch as soon as they have completed.

I took the liberty to replace a few tabs in the patch, and changed some formatting in the new method to stay below 80 lines. Attached modified patch as 'derby-3705-2b.diff'.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705-2.diff, derby-3705-2b.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602586#action_12602586 ] 

Kristian Waagan commented on DERBY-3705:
----------------------------------------

suites.All and derbyall passed.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3705:
-----------------------------------

       Derby Info:   (was: [Patch Available])
    Fix Version/s: 10.5.0.0

Regression tests passed.
Committed 'derby-3705-2b.diff' to trunk with revision 666174.

Thanks for the contribution :)

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3705-2.diff, derby-3705-2b.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka reassigned DERBY-3705:
----------------------------------------

    Assignee: Suran Jayathilaka

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Critical
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka updated DERBY-3705:
-------------------------------------

    Derby Info: [Patch Available]

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Critical
>         Attachments: derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka updated DERBY-3705:
-------------------------------------

    Attachment: derby-3705-2.diff

This patch refactors length checking (for max value and negativity) code to a new method.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.0.0
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>         Attachments: derby-3705-2.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602036#action_12602036 ] 

Suran Jayathilaka commented on DERBY-3705:
------------------------------------------

The same bug applies to client's PreparedStatement.setBinaryStream() and PreparedStatement.setCharacterStream() methods.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Critical
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan closed DERBY-3705.
----------------------------------


Closing issue.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3, 10.5.1.1
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Minor
>             Fix For: 10.5.1.1
>
>         Attachments: derby-3705-2.diff, derby-3705-2b.diff, derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3705) In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()

Posted by "Suran Jayathilaka (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka updated DERBY-3705:
-------------------------------------

    Attachment: derby-3705.diff

Adds a less than zero check to setXXXStream methods in PreparedStatement, which throws an exception with NEGATIVE_STREAM_LENGTH state code if true.

> In Net Client mode, negative values for stream length are accepted without an exception for PreparedStatement.setAsciiStream()
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3705
>                 URL: https://issues.apache.org/jira/browse/DERBY-3705
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3
>         Environment: Windows XP SP2, Derby trunk SVN checkout
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>            Priority: Critical
>         Attachments: derby-3705.diff
>
>
> This is related to Cloudscape bug 4250.
> Pass negative length as the stream length for various setXXXStream methods should throw an exception. But in Net Client mode, passing a negative value as stream length to PreparedStatement.setAsciiStream() doesn't throw an exception.
> e.g. //from store/StreamingColumn
> PreparedStatement ps = prepareStatement("insert into "
> 				+ "testLongVarCharInvalidStreamLength11 values(?, ?, ?)");
> 		ps.setInt(1, 100);
> 		try {
> 			println("===> testing using setAsciiStream with -2 as length");
> 			ps.setAsciiStream(2, fileIn, -2); // should throw exception here but doesn't.
>                  }
> This issue has been fixed for embedded mode, but not for client mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.