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 "Tomohito Nakayama (JIRA)" <de...@db.apache.org> on 2005/12/18 06:18:35 UTC

[jira] Resolved: (DERBY-721) State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .

     [ http://issues.apache.org/jira/browse/DERBY-721?page=all ]
     
Tomohito Nakayama resolved DERBY-721:
-------------------------------------

    Resolution: Fixed

Committed .

Sending        java/client/org/apache/derby/client/am/ResultSet.java
Sending        java/engine/org/apache/derby/iapi/reference/SQLState.java
Sending        java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
Sending        java/engine/org/apache/derby/loc/messages_en.properties
Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out
Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/LOBTest.out
Adding         java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out
Sending        java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out
Adding         java/testing/org/apache/derbyTesting/functionTests/master/Stream.out
Sending        java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out
Sending        java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java
Adding         java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
Transmitting file data ...............
Committed revision 357435.

> State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-721
>          URL: http://issues.apache.org/jira/browse/DERBY-721
>      Project: Derby
>         Type: Bug
>   Components: Unknown
>  Environment: naka@rufelza:~/derby/dev/trunk$ cat /proc/version 
> Linux version 2.6.12-1-386 (horms@tabatha.lab.ultramonkey.org) (gcc version 4.0.2 20050917 (prerelease) (Debian 4.0.1-8)) #1 Tue Sep 27 12:41:08 JST 2005
> naka@rufelza:~/derby/dev/trunk$ java -version
> java version "1.4.2_10"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
> Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)
>     Reporter: Tomohito Nakayama
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-721.patch, DERBY-721_2.patch, DERBY-721_3.patch, DERBY-721_4.patch, DERBY-721_rollback_1+2.patch, testLob.java, testLob2.java, testResult.txt, testResult2.txt
>
> State of InputStream retrieved from ResultSet was not clean , if there exists previous InputStream retrieved from ResultSet .
> Test code ...
> 	PreparedStatement pst = conn.prepareStatement("insert into a(b) values(?)");
> 	byte[] data = new byte[1024 * 1024];
> 	for(int i = 0;
> 	    i < 1024 * 1024;
> 	    i  ++){
> 	    data[i] = (byte)(i % 256);
> 	}
> 	pst.setBinaryStream(1,new ByteArrayInputStream(data),data.length);
> 	pst.executeUpdate();
> 	pst.close();
> 	
> 	
> 	st = conn.createStatement();
> 	ResultSet rs = st.executeQuery("select b from a");
> 	rs.next();
> 	
> 	InputStream is = rs.getBinaryStream(1);
> 	System.out.println("Here goes first stream");
> 	System.out.println(is.read());
> 	System.out.println(is.read());
> 	System.out.println(is.read());
> 	
> 	is = rs.getBinaryStream(1);
> 	System.out.println("Here goes 2nd stream");
> 	System.out.println(is.read());
> 	System.out.println(is.read());
> 	System.out.println(is.read());
> Result ....
> naka@rufelza:~/derby/test/20051121$ java testLob
> Here goes first stream
> 0
> 1
> 2
> Here goes 2nd stream
> 7
> 8
> 9
> It is expected that result printed from first stream is as same as result printed from 2nd.

-- 
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


Re: [jira] Resolved: (DERBY-721) State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.


I found next error of jdbcapi/Stream.java in regression test using DB2 
universal driver .
http://www.multinet.no/~solberg/public/Apache/TinderBox_Derby/testlog/SunOS-5.10_i86pc-i386/357435-derbynetmats_diff.txt

I could not found this problem , because test for DB2 universal driver 
was not executed at my environment in derbyall suite ....


The error tells that modification done in DERBY-721 made different behavior
between using  DB2 universal driver and using Network client JDBC driver .

Because this difference is a natural consequence from decision in 
DERBY-721 ,
I will add master .out file of jdbcapi/Stream.java for DB2 universal 
driver to be passed .


Best regards.


Tomohito Nakayama (JIRA) wrote:

>     [ http://issues.apache.org/jira/browse/DERBY-721?page=all ]
>     
>Tomohito Nakayama resolved DERBY-721:
>-------------------------------------
>
>    Resolution: Fixed
>
>Committed .
>
>Sending        java/client/org/apache/derby/client/am/ResultSet.java
>Sending        java/engine/org/apache/derby/iapi/reference/SQLState.java
>Sending        java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
>Sending        java/engine/org/apache/derby/loc/messages_en.properties
>Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out
>Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/LOBTest.out
>Adding         java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out
>Sending        java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out
>Adding         java/testing/org/apache/derbyTesting/functionTests/master/Stream.out
>Sending        java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out
>Sending        java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
>Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java
>Adding         java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java
>Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
>Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
>Transmitting file data ...............
>Committed revision 357435.
>
>  
>
>>State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .
>>---------------------------------------------------------------------------------------------------
>>
>>         Key: DERBY-721
>>         URL: http://issues.apache.org/jira/browse/DERBY-721
>>     Project: Derby
>>        Type: Bug
>>  Components: Unknown
>> Environment: naka@rufelza:~/derby/dev/trunk$ cat /proc/version 
>>Linux version 2.6.12-1-386 (horms@tabatha.lab.ultramonkey.org) (gcc version 4.0.2 20050917 (prerelease) (Debian 4.0.1-8)) #1 Tue Sep 27 12:41:08 JST 2005
>>naka@rufelza:~/derby/dev/trunk$ java -version
>>java version "1.4.2_10"
>>Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
>>Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)
>>    Reporter: Tomohito Nakayama
>>    Assignee: Tomohito Nakayama
>> Attachments: DERBY-721.patch, DERBY-721_2.patch, DERBY-721_3.patch, DERBY-721_4.patch, DERBY-721_rollback_1+2.patch, testLob.java, testLob2.java, testResult.txt, testResult2.txt
>>
>>State of InputStream retrieved from ResultSet was not clean , if there exists previous InputStream retrieved from ResultSet .
>>Test code ...
>>	PreparedStatement pst = conn.prepareStatement("insert into a(b) values(?)");
>>	byte[] data = new byte[1024 * 1024];
>>	for(int i = 0;
>>	    i < 1024 * 1024;
>>	    i  ++){
>>	    data[i] = (byte)(i % 256);
>>	}
>>	pst.setBinaryStream(1,new ByteArrayInputStream(data),data.length);
>>	pst.executeUpdate();
>>	pst.close();
>>	
>>	
>>	st = conn.createStatement();
>>	ResultSet rs = st.executeQuery("select b from a");
>>	rs.next();
>>	
>>	InputStream is = rs.getBinaryStream(1);
>>	System.out.println("Here goes first stream");
>>	System.out.println(is.read());
>>	System.out.println(is.read());
>>	System.out.println(is.read());
>>	
>>	is = rs.getBinaryStream(1);
>>	System.out.println("Here goes 2nd stream");
>>	System.out.println(is.read());
>>	System.out.println(is.read());
>>	System.out.println(is.read());
>>Result ....
>>naka@rufelza:~/derby/test/20051121$ java testLob
>>Here goes first stream
>>0
>>1
>>2
>>Here goes 2nd stream
>>7
>>8
>>9
>>It is expected that result printed from first stream is as same as result printed from 2nd.
>>    
>>
>
>  
>

-- 
/*

        Tomohito Nakayama
        tomonaka@basil.ocn.ne.jp
        tomohito@rose.zero.ad.jp
        tmnk@apache.org

        Naka
        http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/