|
|||||||||||
|
Connector/NET commit: r1048 - in branches/5.0: . Driver/Source
From: <rburnett(at)mysql.com>
Date: Wed Oct 31 2007 - 17:26:19 EDT
branches/5.0/CHANGES branches/5.0/Driver/Source/MySqlStream.cs branches/5.0/Driver/Source/NativeDriver.csLog: sped up LOAD DATA LOCAL INFILE dramatically by bypassing the normal stream processing code in MySqlStream Modified: branches/5.0/CHANGES
Version 5.0.8 8/16/2007 Modified: branches/5.0/Driver/Source/MySqlStream.cs
+ public void SendEntirePacketDirectly(byte[] buffer, int count)
+ {
+ buffer[0] = (byte)(count & 0xff);
+ buffer[1] = (byte)((count >> 8) & 0xff);
+ buffer[2] = (byte)((count >> 16) & 0xff);
+ buffer[3] = sequenceByte++;
+ baseStream.Write(buffer, 0, count + 4);
+ }
+
/// Modified: branches/5.0/Driver/Source/NativeDriver.cs
+ long len = 0;
try
{
fs = new FileStream(filename, FileMode.Open);
- stream.StartOutput((ulong)fs.Length, false);
-
- long len = fs.Length;
+ len = fs.Length;
while (len > 0)
{
- int count = fs.Read(buffer, 0, 4092);
- stream.Write(buffer, 0, count);
+ int count = fs.Read(buffer, 4, (int)(len > 8192 ? 8192 : len));
+ stream.SendEntirePacketDirectly(buffer, count);
len -= count;
}
-
- // write the terminating packet
- stream.SendEmptyPacket();
- stream.Flush();
+ stream.SendEntirePacketDirectly(buffer, 0);
}
catch (Exception ex)
{
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Wed Oct 31 17:26:22 2007 This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 11:15:02 EDT |
||||||||||
|
|||||||||||