db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r418691 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/DRDAConnThread.java testing/org/apache/derbyTesting/functionTests/master/testProtocol.out testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
Date Mon, 03 Jul 2006 05:57:33 GMT
Author: kahatlen
Date: Sun Jul  2 22:57:33 2006
New Revision: 418691

URL: http://svn.apache.org/viewvc?rev=418691&view=rev
Log:
DERBY-1468: Server returns data when it receives a QRYROWSET value of
zero on an OPNQRY, which doesn't follow DRDA protocol.

The patch disables pre-fetching for LMTBLKPRC when QRYROWSET=0 and
adds a test case to the protocol test which sends an OPNQRY for a
scrollable cursor with QRYROWSET=0.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=418691&r1=418690&r2=418691&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 Sun Jul 
2 22:57:33 2006
@@ -772,7 +772,8 @@
 
 							stmt.rsSuspend();
 
-							if (stmt.getQryprctyp() == CodePoint.LMTBLKPRC) {
+							if (stmt.getQryprctyp() == CodePoint.LMTBLKPRC &&
+									stmt.getQryrowset() != 0) {
 								// The DRDA spec allows us to send
 								// QRYDTA here if there are no LOB
 								// columns.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out?rev=418691&r1=418690&r2=418691&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
Sun Jul  2 22:57:33 2006
@@ -161,6 +161,8 @@
 PASSED
 Test invalid value for QRYROWSET on OPNQRY
 PASSED
+Test QRYROWSET=0 on OPNQRY with scrollable cursor
+PASSED
 Test to see OPNQRY returns PRCCNVRM if non-existent RDBNAM specified
 PASSED
 Test too large value for QRYRFRTBL codepoint on CNTQRY

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests?rev=418691&r1=418690&r2=418691&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
Sun Jul  2 22:57:33 2006
@@ -1857,6 +1857,68 @@
 checkerror SYNTAXRM 8 20 QRYROWSET
 endTest
 //
+DISPLAY "Test QRYROWSET=0 on OPNQRY with scrollable cursor"
+include connect.inc
+createDssRequest
+startDdm PRPSQLSTT
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLATTR
+writeByte 0	// null indicator
+writeEncodedLDString "SCROLL INSENSITIVE WITH HOLD" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+startDdm SQLSTT
+writeByte 0	// null indicator
+writeEncodedLDString "values(1)" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+endDss
+flush
+checkSQLCard 0 "     "
+createDssRequest
+startDdm OPNQRY
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+startDdm QRYBLKSZ
+writeInt 32767
+endDdm
+startDdm QRYROWSET
+writeInt 0
+endDdm
+endDdm
+endDss
+flush
+readReplyDss
+readLengthAndCodepoint OPNQRYRM
+skipBytes
+readReplyDss
+readLengthAndCodepoint QRYDSC
+skipBytes
+// DERBY-1468: QRYDTA was incorrectly sent here.
+// Send an invalid CNTQRY and check that the next
+// response is an error instead of QRYDTA.
+createDssRequest
+startDdm CNTQRY
+endDdm
+endDss
+flush
+checkError SYNTAXRM 8 14 PKGNAMCSN
+endTest
+//
 DISPLAY "Test to see OPNQRY returns PRCCNVRM if non-existent RDBNAM specified"
 include connect.inc
 createDssRequest



Mime
View raw message