db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r612901 - in /db/derby/code/branches/10.3/java: client/org/apache/derby/client/net/NetCursor.java testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java
Date Thu, 17 Jan 2008 18:10:49 GMT
Author: kmarsden
Date: Thu Jan 17 10:10:46 2008
New Revision: 612901

URL: http://svn.apache.org/viewvc?rev=612901&view=rev
Log:
DERBY-3230 Selecting data from a Table raises Error XN008: Query processing has been terminated
due to an error on the server

port revision 612849 from trunk.


Modified:
    db/derby/code/branches/10.3/java/client/org/apache/derby/client/net/NetCursor.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java

Modified: db/derby/code/branches/10.3/java/client/org/apache/derby/client/net/NetCursor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/client/org/apache/derby/client/net/NetCursor.java?rev=612901&r1=612900&r2=612901&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/client/org/apache/derby/client/net/NetCursor.java (original)
+++ db/derby/code/branches/10.3/java/client/org/apache/derby/client/net/NetCursor.java Thu
Jan 17 10:10:46 2008
@@ -146,7 +146,12 @@
         }
 
         NetSqlca[] netSqlca = this.parseSQLCARD(qrydscTypdef_);
-
+        // If we don't have at least one byte in the buffer for the DA null indicator,
+        // then we need to send a CNTQRY request to fetch the next block of data.
+        // Read the DA null indicator. Do this before we close mark the statement
+        // closed on the server. DERBY-3230
+        daNullIndicator = readFdocaOneByte();
+        
         if (netSqlca != null) {
             for (int i=0;i<netSqlca.length; i++) {
                 int sqlcode = netSqlca[i].getSqlCode();
@@ -183,10 +188,7 @@
         setIsUpdataDeleteHole(rowIndex, receivedDeleteHoleWarning);
         setIsRowUpdated(receivedRowUpdatedWarning);
         
-        // If we don't have at least one byte in the buffer for the DA null indicator,
-        // then we need to send a CNTQRY request to fetch the next block of data.
-        // Read the DA null indicator.
-        daNullIndicator = readFdocaOneByte();
+        
 
         // In the case for held cursors, the +100 comes back as part of the QRYDTA, and as
         // we are parsing through the row that contains the SQLCA with +100, we mark the

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java?rev=612901&r1=612900&r2=612901&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java
(original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/PrepareStatementTest.java
Thu Jan 17 10:10:46 2008
@@ -1249,6 +1249,41 @@
     }
 
     /**
+     * Test fix for protocol error if splitQRYDTA occurs during DRDAConnThread.doneData()
+     * DERBY-3230
+     * @throws SQLException
+     */
+    public void testDerby3230() throws SQLException {
+        Statement s = createStatement();
+        s.executeUpdate("CREATE TABLE TAB (col1 varchar(32672) NOT NULL)");
+        PreparedStatement ps = prepareStatement("INSERT INTO TAB VALUES(?)");
+        ps.setString(1,makeString(15000));
+        ps.executeUpdate();
+        ps.setString(1,makeString(7500));
+        ps.executeUpdate();
+        ps.setString(1,makeString(5000));
+        ps.executeUpdate();
+        ps.setString(1,makeString(2000));
+        ps.executeUpdate();
+        ps.setString(1,makeString(1600));
+        ps.executeUpdate();
+        ps.setString(1,makeString(800));
+        ps.executeUpdate();
+        ps.setString(1,makeString(400));
+        ps.executeUpdate();
+        ps.setString(1,makeString(200));
+        ps.executeUpdate();
+        ps.setString(1,makeString(100));
+        ps.executeUpdate();
+        ps.setString(1,makeString(56));
+        ps.executeUpdate();
+            
+        ResultSet rs = s.executeQuery("SELECT * from tab");
+        // drain the resultset
+        JDBC.assertDrainResults(rs);
+                   
+    }
+    /**
      * Return a string of the given length.  The string will contain just 'X'
      * characters.
      *



Mime
View raw message