Issue Details (XML | Word | Printable)

Key: DERBY-721
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Tomohito Nakayama
Reporter: Tomohito Nakayama
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .

Created: 21/Nov/05 08:23 PM   Updated: 30/Jun/09 04:12 PM
Return to search
Component/s: JDBC, Network Client
Affects Version/s: None
Fix Version/s: 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works DERBY-721.patch 2005-11-24 11:24 PM Tomohito Nakayama 6 kB
Text File Licensed for inclusion in ASF works DERBY-721_2.patch 2005-11-29 12:59 AM Tomohito Nakayama 6 kB
Text File Licensed for inclusion in ASF works DERBY-721_3.patch 2005-12-03 03:12 PM Tomohito Nakayama 5 kB
Text File Licensed for inclusion in ASF works DERBY-721_4.patch 2005-12-16 12:05 AM Tomohito Nakayama 180 kB
Text File Licensed for inclusion in ASF works DERBY-721_5.patch 2005-12-19 11:59 PM Tomohito Nakayama 0.9 kB
Text File Licensed for inclusion in ASF works DERBY-721_rollback_1+2.patch 2005-12-08 10:36 PM Tomohito Nakayama 10 kB
Java Source File Licensed for inclusion in ASF works testLob.java 2005-11-21 08:26 PM Tomohito Nakayama 2 kB
Java Source File Licensed for inclusion in ASF works testLob2.java 2005-11-28 08:53 PM Tomohito Nakayama 2 kB
Text File Licensed for inclusion in ASF works testResult.txt 2005-11-21 08:26 PM Tomohito Nakayama 0.1 kB
Text File Licensed for inclusion in ASF works testResult2.txt 2005-11-28 08:53 PM Tomohito Nakayama 0.1 kB
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)
Issue Links:
Blocker
 
Reference
 

Issue & fix info: Release Note Needed
Resolution Date: 20/Dec/05 09:10 PM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #349079 Sat Nov 26 05:14:15 UTC 2005 tmnk - DERBY-721 State of InputStream retrieved from resultset is not clean , if there exists previous InputStream - Patch by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java

Repository Revision Date User Message
ASF #349718 Tue Nov 29 14:02:22 UTC 2005 tmnk - DERBY-721_2 State of Reader retrieved from resultset is not clean , if there exists previous Reader - Patch by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java

Repository Revision Date User Message
ASF #355437 Fri Dec 09 10:20:02 UTC 2005 tmnk - rollback DERBY-721 and DERBY-721_2 because they will implicitly restrict spec of network driver. - Patch by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java

Repository Revision Date User Message
ASF #357435 Sun Dec 18 05:15:39 UTC 2005 tmnk - DERBY-721_4 - State of InputStream retrieved from resultset is not clean , if there exists previous InputStream . Patch to throw exception if user get stream for a value in result set twice . by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/LOBTest.out
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Stream.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Stream.out

Repository Revision Date User Message
ASF #357966 Tue Dec 20 12:09:51 UTC 2005 tmnk - DERBY-721_5 State of InputStream retrieved from resultset is not clean , if there exists previous InputStream . Add mater .out file to be passed using DB2 universal driver. - Patch by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)
Files Changed
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/Stream.out