List:Commits« Previous MessageNext Message »
From:mmatthews Date:February 9 2007 6:19pm
Subject:Connector/J commit: r6308 - branches/branch_5_0/connector-j/src/com/mysql/jdbc
View as plain text  
Modified:
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java
Log:
use skipPacket() instead of reusable packet to skip over cached metadata packets.

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java	2007-02-09 00:04:45 UTC (rev 6307)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java	2007-02-09 18:19:34 UTC (rev 6308)
@@ -381,6 +381,7 @@
             }
         } else {
         	for (int i = 0; i < columnCount; i++) {
+        		//reuseAndReadPacket(this.reusablePacket); // essentially skip it, using a pre-existing buffer
         		skipPacket();
         	}
         }
@@ -1975,6 +1976,26 @@
 
         return n;
     }
+    
+    private final long skipFully(InputStream in, long len) throws IOException {
+    	if (len < 0) {
+    		throw new IOException("Negative skip length not allowed");
+    	}
+    	
+    	long n = 0;
+    	
+    	while (n < len) {
+    		long count = in.skip(len - n);
+    		
+    		if (count < 0) {
+    			throw new EOFException();
+    		}
+    		
+    		n += count;
+    	}
+    	
+    	return n;
+    }
 
     /**
      * Reads one result set off of the wire, if the result is actually an

Thread
Connector/J commit: r6308 - branches/branch_5_0/connector-j/src/com/mysql/jdbcmmatthews9 Feb