db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r355689 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functionTests/mast...
Date Sat, 10 Dec 2005 01:51:41 GMT
Author: kmarsden
Date: Fri Dec  9 17:51:26 2005
New Revision: 355689

URL: http://svn.apache.org/viewcvs?rev=355689&view=rev
Log:
DERBY-614 Execution failed because of a Distributed Protocol Error

Fixes the split logic when data passes the blksize boundary.
Details of the fix are in spec.html attached to DERBY-614

Contributed by Bryan Pendleton


Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/big.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/prepStmt.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/big.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/prepStmt.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmt.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Fri Dec 
9 17:51:26 2005
@@ -5851,7 +5851,43 @@
 	/**
 	 * Write QRYDTA - Query Answer Set Data
 	 *  Contains some or all of the answer set data resulting from a query
-	 *  returns true if there is more data, false if we reached the end
+	 *  If the client is not using rowset processing, this routine attempts
+	 *  to pack as much data into the QRYDTA as it can. This may result in
+	 *  splitting the last row across the block, in which case when the
+	 *  client calls CNTQRY we will return the remainder of the row.
+	 *
+	 *  Splitting a QRYDTA block is expensive, for several reasons:
+	 *  - extra logic must be run, on both client and server side
+	 *  - more network round-trips are involved
+	 *  - the QRYDTA block which contains the continuation of the split
+	 *    row is generally wasteful, since it contains the remainder of
+	 *    the split row but no additional rows.
+	 *  Since splitting is expensive, the server makes some attempt to
+	 *  avoid it. Currently, the server's algorithm for this is to
+	 *  compute the length of the current row, and to stop trying to pack
+	 *  more rows into this buffer if another row of that length would
+	 *  not fit. However, since rows can vary substantially in length,
+	 *  this algorithm is often ineffective at preventing splits. For
+	 *  example, if a short row near the end of the buffer is then
+	 *  followed by a long row, that long row will be split. It is possible
+	 *  to improve this algorithm substantially:
+	 *  - instead of just using the length of the previous row as a guide
+	 *    for whether to attempt packing another row in, use some sort of
+	 *    overall average row size computed over multiple rows (e.g., all
+	 *    the rows we've placed into this QRYDTA block, or all the rows
+	 *    we've process for this result set)
+	 *  - when we discover that the next row will not fit, rather than
+	 *    splitting the row across QRYDTA blocks, if it is relatively
+	 *    small, we could just hold the entire row in a buffer to place
+	 *    it entirely into the next QRYDTA block, or reset the result
+	 *    set cursor back one row to "unread" this row.
+	 *  - when splitting a row across QRYDTA blocks, we tend to copy
+	 *    data around multiple times. Careful coding could remove some
+	 *    of these copies.
+	 *  However, it is important not to over-complicate this code: it is
+	 *  better to be correct than to be efficient, and there have been
+	 *  several bugs in the split logic already.
+	 *
 	 * Instance Variables
 	 *   Byte string
 	 *
@@ -5870,13 +5906,29 @@
 		if (SanityManager.DEBUG) 
 			trace("Write QRYDTA");
 		writer.startDdm(CodePoint.QRYDTA);
+		// Check to see if there was leftover data from splitting
+		// the previous QRYDTA for this result set. If there was, and
+		// if we have now sent all of it, send any EXTDTA for that row
+		// and increment the rowCount which we failed to increment in
+		// writeFDODTA when we realized the row needed to be split.
+		if (processLeftoverQRYDTA(stmt))
+		{
+			if (stmt.getSplitQRYDTA() == null)
+			{
+				stmt.rowCount += 1;
+				if (stmt.getExtDtaObjects() != null)
+					writeEXTDTA(stmt);
+			}
+			return;
+		}
 		
 		while(getMoreData)
 		{			
 			sentExtData = false;
 			getMoreData = writeFDODTA(stmt);
 
-			if (stmt.getExtDtaObjects() != null)
+			if (stmt.getExtDtaObjects() != null &&
+					stmt.getSplitQRYDTA() == null)
 			{
 				writer.endDdmAndDss();
 				writeEXTDTA(stmt);
@@ -5910,6 +5962,48 @@
 		}
 	}
 
+	/**
+	 * This routine places some data into the current QRYDTA block using
+	 * FDODTA (Formatted Data Object DaTA rules).
+	 *
+	 * There are 3 basic types of processing flow for this routine:
+	 * - In normal non-rowset, non-scrollable cursor flow, this routine
+	 *   places a single row into the QRYDTA block and returns TRUE,
+	 *   indicating that the caller can call us back to place another
+	 *   row into the result set if he wishes. (The caller may need to
+	 *   send Externalized Data, which would be a reason for him NOT to
+	 *   place any more rows into the QRYDTA).
+	 * - In ROWSET processing, this routine places an entire ROWSET of
+	 *   rows into the QRYDTA block and returns FALSE, indicating that
+	 *   the QRYDTA block is full and should now be sent.
+	 * - In callable statement processing, this routine places the
+	 *   results from the output parameters of the called procedure into
+	 *   the QRYDTA block. This code path is really dramatically
+	 *   different from the other two paths and shares only a very small
+	 *   amount of common code in this routine.
+	 *
+	 * In all cases, it is possible that the data we wish to return may
+	 * not fit into the QRYDTA block, in which case we call splitQRYDTA
+	 * to split the data and remember the remainder data in the result set.
+	 * Splitting the data is relatively rare in the normal cursor case,
+	 * because our caller (writeQRYDTA) uses a coarse estimation
+	 * technique to avoid calling us if he thinks a split is likely.
+	 *
+	 * The overall structure of this routine is implemented as two
+	 * loops:
+	 * - the outer "do ... while ... " loop processes a ROWSET, one row
+	 *   at a time. For non-ROWSET cursors, and for callable statements,
+	 *   this loop executes only once.
+	 * - the inner "for ... i < numCols ..." loop processes each column
+	 *   in the current row, or each output parmeter in the procedure.
+	 *
+	 * Most column data is written directly inline in the QRYDTA block.
+	 * Some data, however, is written as Externalized Data. This is
+	 * commonly used for Large Objects. In that case, an Externalized
+	 * Data Pointer is written into the QRYDTA block, and the actual
+	 * data flows in separate EXTDTA blocks which are returned
+	 * after this QRYDTA block.
+	 */
 	private boolean writeFDODTA (DRDAStatement stmt) 
 		throws DRDAProtocolException, SQLException
 	{
@@ -6079,7 +6173,7 @@
 			if (writer.getOffset() >= blksize)
 			{
 				splitQRYDTA(stmt, blksize);
-				moreData = false;
+				return false;
 			}
 
 			if (rs == null)
@@ -6116,6 +6210,11 @@
 	/**
 	 * Split QRYDTA into blksize chunks
 	 *
+	 * This routine is called if the QRYDTA data will not fit. It writes
+	 * as much data as it can, then stores the remainder in the result
+	 * set. At some later point, when the client returns with a CNTQRY,
+	 * we will call processLeftoverQRYDTA to handle that data.
+	 *
 	 * @param stmt DRDA statment
 	 * @param blksize size of query block
 	 * 
@@ -6129,36 +6228,54 @@
 		byte [] temp = writer.copyDataToEnd(blksize);
 		// truncate to end of blocksize
 		writer.setOffset(blksize);
-		int remain = temp.length;
-		int start = 0;
-		int dataLen = blksize - 10; //DSS header + QRYDTA and length
-		while (remain > 0)
+		if (temp.length == 0)
+			agentError("LMTBLKPRC violation: splitQRYDTA was " +
+				"called to split a QRYDTA block, but the " +
+				"entire row fit successfully into the " +
+				"current block. Server rowsize computation " +
+				"was probably incorrect (perhaps an off-by-" +
+				"one bug?). QRYDTA blocksize: " + blksize);
+		stmt.setSplitQRYDTA(temp);
+	}
+	/*
+	 * Process remainder data resulting from a split.
+	 *
+	 * This routine is called at the start of building each QRYDTA block.
+	 * Normally, it observes that there is no remainder data from the
+	 * previous QRYDTA block, and returns FALSE, indicating that there
+	 * was nothing to do.
+	 *
+	 * However, if it discovers that the previous QRYDTA block was split,
+	 * then it retrieves the remainder data from the result set, writes
+	 * as much of it as will fit into the QRYDTA block (hopefully all of
+	 * it will fit, but the row may be very long), and returns TRUE,
+	 * indicating that this QRYDTA block has been filled with remainder
+	 * data and should now be sent immediately.
+	 */
+	private boolean processLeftoverQRYDTA(DRDAStatement stmt)
+		throws SQLException,DRDAProtocolException
+	{
+		byte []leftovers = stmt.getSplitQRYDTA();
+		if (leftovers == null)
+			return false;
+		int blksize = stmt.getBlksize() > 0 ? stmt.getBlksize() : CodePoint.QRYBLKSZ_MAX;
+		blksize = blksize - 10; //DSS header + QRYDTA and length
+		if (leftovers.length < blksize)
 		{
-			// finish off query block and send
-			writer.endDdmAndDss();
-			finalizeChain();
-			// read CNTQRY - not sure why JCC sends this
-			correlationID = reader.readDssHeader();
-			int codePoint = reader.readLengthAndCodePoint();
-			DRDAStatement contstmt = parseCNTQRY();
-			if (stmt != contstmt)
-				agentError("continued query stmt not the same");
-			// start a new query block for the next row
-			writer.createDssObject();
-			writer.startDdm(CodePoint.QRYDTA);
-			// write out remaining data
-			if (remain > blksize)
-			{
-				writer.writeBytes(temp, start, dataLen);
-				remain -= dataLen; //DSS header + QRYDTA and length
-				start += dataLen;
-			}
-			else
-			{
-				writer.writeBytes(temp, start, remain);
-				remain = 0;
-			}
+			writer.writeBytes(leftovers, 0, leftovers.length);
+			stmt.setSplitQRYDTA(null);
+		}
+		else
+		{
+			writer.writeBytes(leftovers, 0, blksize);
+			byte []newLeftovers = new byte[leftovers.length-blksize];
+			for (int i = 0; i < newLeftovers.length; i++)
+				newLeftovers[i] = leftovers[blksize+i];
+			stmt.setSplitQRYDTA(newLeftovers);
 		}
+		// finish off query block and send
+		writer.endDdmAndDss();
+		return true;
 	}
 	/**
 	 * Done data

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java Fri Dec  9
17:51:26 2005
@@ -82,6 +82,13 @@
 
 	protected String pkgcnstknStr;               // Unique consistency token for ResultSet 0
 
+	// splitQRYDTA is normally null. If it is non-null, it means that
+	// the last QRYDTA response which was sent for this statement was
+	// split according to the LMTBLKPRC protocol, and this array contains
+	// the bytes that didn't fit. These bytes should be the first bytes
+	// emitted in the next QRYDTA response to a CNTQRY request.
+	private byte []splitQRYDTA;
+
 	protected DRDAResultSet()
 	{
 		state = NOT_OPENED;
@@ -127,6 +134,15 @@
 		return rs;
 	}
 
+	public void setSplitQRYDTA(byte []data)
+	{
+		splitQRYDTA = data;
+	}
+	public byte[]getSplitQRYDTA()
+	{
+		return splitQRYDTA;
+	}
+
 	/** 
 	 * Set ResultSet DRDA DataTypes
 	 * @param value drdaTypes for columns.
@@ -510,4 +526,4 @@
 		this.qryclsimp = (qryclsimpl == CodePoint.QRYCLSIMP_SERVER_CHOICE)
 			? DRDAResultSet.QRYCLSIMP_DEFAULT : qryclsimpl;
 	}
-}
\ No newline at end of file
+}

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java Fri Dec  9
17:51:26 2005
@@ -222,6 +222,15 @@
 	{
 		currentDrdaRs.setExtDtaObjects(a);
 	}
+
+	public void setSplitQRYDTA(byte []data)
+	{
+		currentDrdaRs.setSplitQRYDTA(data);
+	}
+	public byte[]getSplitQRYDTA()
+	{
+		return currentDrdaRs.getSplitQRYDTA();
+	}
 	
    	/**
 	 * Add extDtaObject

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/big.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/big.out?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/big.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/big.out
Fri Dec  9 17:51:26 2005
@@ -34,7 +34,83 @@
 C1 |C2                                                                                  
                                           
 -----
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
-ij> -- what happens when the row + the ending SQLCARD is too big
+ij> -- Various tests for JIRA-614: handling of rows which span QRYDTA blocks.
+----- what happens when the SplitQRYDTA has to span 3+ blocks
+drop table big;
+0 rows inserted/updated/deleted
+ij> create table big(c1 varchar(32672), c2 varchar(32672), c3 varchar(32672), c4 varchar(32672));
+0 rows inserted/updated/deleted
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> get scroll insensitive cursor c1 as 'select * from big';
+ij> first c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> next c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> previous c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> last c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> close c1;
+ij> drop table big;
+0 rows inserted/updated/deleted
+ij> -- Mix clob and varchar in the table.
+create table big(c1 clob(32672), c2 varchar(32672), c3 varchar(32672), c4 clob(32672));
+0 rows inserted/updated/deleted
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> -- This seems to reveal some sort of different problem than JIRA 614. I get a
+----- DRDAProtocolException, but it isn't one which involves splitQRYDTA.
+----- get scroll insensitive cursor c1 as 'select * from big';
+----- first c1;
+----- next c1;
+----- previous c1;
+----- last c1;
+----- close c1;
+----- End of the JIRA-614 tests.
+----- what happens when the row + the ending SQLCARD is too big
 drop table big;
 0 rows inserted/updated/deleted
 ij> create table big(c1 varchar(30000), c2 varchar(2750));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/prepStmt.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/prepStmt.out?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/prepStmt.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/prepStmt.out
Fri Dec  9 17:51:26 2005
@@ -75,4 +75,5 @@
 setObject Method sets the designated parameter with the Object
 Negative test setString with Invalid Timestamp:20
 SQLState: 22007 message: The syntax of the string representation of a datetime value is incorrect.
+Test jira614 completed successfully -- no Distributed Protocol Exception occurred
 prepStmt Test Ends

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/big.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/big.out?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/big.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/big.out
Fri Dec  9 17:51:26 2005
@@ -34,7 +34,83 @@
 C1 |C2                                                                                  
                                           
 -----
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
-ij> -- what happens when the row + the ending SQLCARD is too big
+ij> -- Various tests for JIRA-614: handling of rows which span QRYDTA blocks.
+----- what happens when the SplitQRYDTA has to span 3+ blocks
+drop table big;
+0 rows inserted/updated/deleted
+ij> create table big(c1 varchar(32672), c2 varchar(32672), c3 varchar(32672), c4 varchar(32672));
+0 rows inserted/updated/deleted
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> get scroll insensitive cursor c1 as 'select * from big';
+ij> first c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> next c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> previous c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> last c1;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> close c1;
+ij> drop table big;
+0 rows inserted/updated/deleted
+ij> -- Mix clob and varchar in the table.
+create table big(c1 clob(32672), c2 varchar(32672), c3 varchar(32672), c4 clob(32672));
+0 rows inserted/updated/deleted
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> execute p1 using 'values 9';
+IJ WARNING: Autocommit may close using result set
+Statement executed.
+ij> select * from big;
+C1 |C2 |C3 |C4                                                                          
                                                   
+-----
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&
|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&
|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
|ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd&
+ij> -- This seems to reveal some sort of different problem than JIRA 614. I get a
+----- DRDAProtocolException, but it isn't one which involves splitQRYDTA.
+----- get scroll insensitive cursor c1 as 'select * from big';
+----- first c1;
+----- next c1;
+----- previous c1;
+----- last c1;
+----- close c1;
+----- End of the JIRA-614 tests.
+----- what happens when the row + the ending SQLCARD is too big
 drop table big;
 0 rows inserted/updated/deleted
 ij> create table big(c1 varchar(30000), c2 varchar(2750));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/prepStmt.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/prepStmt.out?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/prepStmt.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/prepStmt.out
Fri Dec  9 17:51:26 2005
@@ -75,4 +75,5 @@
 setObject Method sets the designated parameter with the Object
 Negative test setString with Invalid Timestamp:20
 SQLState: 22007 message: The syntax of the string representation of a datetime value is incorrect.
+Test jira614 completed successfully -- no Distributed Protocol Exception occurred
 prepStmt Test Ends

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmt.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmt.out?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmt.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmt.out
Fri Dec  9 17:51:26 2005
@@ -75,4 +75,5 @@
 setObject Method sets the designated parameter with the Object
 Negative test setString with Invalid Timestamp:20
 SQLState: 22007 message: The syntax of the string representation of a datetime value is incorrect.
+Test jira614 completed successfully -- no Distributed Protocol Exception occurred
 prepStmt Test Ends

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java
Fri Dec  9 17:51:26 2005
@@ -300,6 +300,7 @@
 			test4975(conn);
 			test5130(conn);
 			test5172(conn);
+			jira614Test(conn);
 			conn.close();
 			System.out.println("prepStmt Test Ends");
         }
@@ -684,5 +685,50 @@
 	}
 
 	
+	// Derby bug 614 has to do with how the server responds when the
+	// client closes the statement in between split QRYDTA blocks. We
+	// have to cause a split QRYDTA block, which we can do by having a
+	// bunch of moderately-sized rows which mostly fill a 32K block
+	// followed by a single giant row which overflows the block. Then,
+	// we fetch some of the rows, then close the result set.
+    private static void jira614Test(Connection conn)
+	    throws Exception
+    {
+	    Statement stmt = conn.createStatement();
+            PreparedStatement ps ;
+	    try {
+		    stmt.execute("drop table jira614");
+	    } catch (Throwable t) { }
+	    ps = conn.prepareStatement(
+			    "create table jira614 (c1 varchar(10000))");
+	    ps.executeUpdate();
+	    String workString = genString("a", 150);
+	    ps = conn.prepareStatement("insert into jira614 values (?)");
+	    ps.setString(1, workString);
+	    for (int row = 0; row < 210; row++)
+		    ps.executeUpdate();
+	    workString = genString("b", 10000);
+	    ps.setString(1, workString);
+	    ps.executeUpdate();
+	    ps = conn.prepareStatement("select * from jira614");
+            ResultSet rs = ps.executeQuery();
+
+            int rowNum = 0;
+            while (rs.next())
+            {
+                rowNum++;
+                if (rowNum == 26)
+                    break;
+            }
+            rs.close(); // This statement actually triggers the bug.
+	    System.out.println("Test jira614 completed successfully -- no Distributed Protocol Exception
occurred");
+    }
+    private static String genString(String c, int howMany)
+    {
+	    StringBuffer buf = new StringBuffer();
+	    for (int i = 0; i < howMany; i++)
+		    buf.append(c);
+	    return buf.toString();
+    }
 }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql
Fri Dec  9 17:51:26 2005
@@ -17,6 +17,39 @@
 execute p1 using 'values 5';
 select * from big;
 
+-- Various tests for JIRA-614: handling of rows which span QRYDTA blocks.
+-- what happens when the SplitQRYDTA has to span 3+ blocks
+drop table big;
+create table big(c1 varchar(32672), c2 varchar(32672), c3 varchar(32672), c4 varchar(32672));
+execute p1 using 'values 9';
+select * from big;
+execute p1 using 'values 9';
+execute p1 using 'values 9';
+select * from big;
+get scroll insensitive cursor c1 as 'select * from big';
+first c1;
+next c1;
+previous c1;
+last c1;
+close c1;
+drop table big;
+-- Mix clob and varchar in the table.
+create table big(c1 clob(32672), c2 varchar(32672), c3 varchar(32672), c4 clob(32672));
+execute p1 using 'values 9';
+select * from big;
+execute p1 using 'values 9';
+execute p1 using 'values 9';
+select * from big;
+-- This seems to reveal some sort of different problem than JIRA 614. I get a
+-- DRDAProtocolException, but it isn't one which involves splitQRYDTA.
+-- get scroll insensitive cursor c1 as 'select * from big';
+-- first c1;
+-- next c1;
+-- previous c1;
+-- last c1;
+-- close c1;
+-- End of the JIRA-614 tests.
+
 -- what happens when the row + the ending SQLCARD is too big
 drop table big;
 create table big(c1 varchar(30000), c2 varchar(2750));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java?rev=355689&r1=355688&r2=355689&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ProcedureTest.java
Fri Dec  9 17:51:26 2005
@@ -214,6 +214,13 @@
 				ps.executeUpdate();
 				ps.close();
 				break;
+			case 9:
+				String lStringA32672 = new String(Formatters.repeatChar("a",32672));
+				String lStringB32672 = new String(Formatters.repeatChar("b",32672));
+				String lStringC32672 = new String(Formatters.repeatChar("c",32672));
+				String lStringD32672 = new String(Formatters.repeatChar("d",32672));
+				insertInBig(conn, lStringA32672, lStringB32672, lStringC32672, lStringD32672);
+				break;
 		}
 		conn.close();
 	}



Mime
View raw message