Modified:
trunk/Driver/MySql.Data.CF.csproj
trunk/Driver/Source/Field.cs
trunk/Driver/Source/ISSchemaProvider.cs
trunk/Driver/Source/Installer.cs
trunk/Driver/Source/Logger.cs
trunk/Driver/Source/MySqlClientFactory.cs
trunk/Driver/Source/MySqlConnectionStringBuilder.cs
trunk/Driver/Source/MySqlError.cs
trunk/Driver/Source/MySqlHelper.cs
trunk/Driver/Source/MySqlPool.cs
trunk/Driver/Source/MySqlStream.cs
trunk/Driver/Source/NativeDriver.cs
trunk/Driver/Source/common/NamedPipeStream.cs
trunk/Driver/Source/common/NativeMethods.cs
trunk/Driver/Source/common/SHA1.cs
trunk/Driver/Source/common/Semaphore.cs
trunk/Driver/Source/common/SharedMemoryStream.cs
trunk/Driver/Source/common/SocketStream.cs
trunk/Driver/Source/common/SqlTokenizer.cs
trunk/Driver/Source/common/StreamCreator.cs
trunk/Driver/Source/common/Version.cs
trunk/Driver/Source/parameter.cs
trunk/Driver/Source/parameter_collection.cs
Log:
more ReSharper cleanups
Modified: trunk/Driver/MySql.Data.CF.csproj
===================================================================
--- trunk/Driver/MySql.Data.CF.csproj 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/MySql.Data.CF.csproj 2007-05-21 14:50:24 UTC (rev 728)
@@ -56,7 +56,6 @@
<Compile Include="Source\base\DbException.cs" />
<Compile Include="Source\CharSetMap.cs" />
<Compile Include="Source\command.cs">
- <SubType>Component</SubType>
</Compile>
<Compile Include="Source\CommandBuilder.cs">
<SubType>Component</SubType>
@@ -79,7 +78,6 @@
</Compile>
<Compile Include="Source\Crypt.cs" />
<Compile Include="Source\dataadapter.cs">
- <SubType>Component</SubType>
</Compile>
<Compile Include="Source\datareader.cs" />
<Compile Include="Source\Driver.cs" />
Modified: trunk/Driver/Source/Field.cs
===================================================================
--- trunk/Driver/Source/Field.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/Field.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -18,7 +18,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System.Globalization;
using System.Text;
using MySql.Data.Common;
using MySql.Data.Types;
@@ -230,7 +229,7 @@
}*/
}
- private void CheckForExceptions()
+/* private void CheckForExceptions()
{
string colName = OriginalColumnName.ToLower(CultureInfo.InvariantCulture);
if (colName.StartsWith("char("))
@@ -238,6 +237,7 @@
else if (connection.IsExecutingBuggyQuery)
binaryOk = false;
}
+ */
public IMySqlValue GetValueObject()
{
Modified: trunk/Driver/Source/ISSchemaProvider.cs
===================================================================
--- trunk/Driver/Source/ISSchemaProvider.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/ISSchemaProvider.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -24,7 +24,6 @@
using MySql.Data.Common;
using System.Globalization;
using System.Diagnostics;
-using System.Collections;
using System.Data.SqlTypes;
using MySql.Data.Types;
@@ -155,7 +154,7 @@
where.AppendFormat(CultureInfo.InvariantCulture, "C.column_name='{0}' ",
restrictions[3]);
}
if (where.Length > 0)
- sql.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}",
where.ToString());
+ sql.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}", where);
DataTable dt = GetTable(sql.ToString());
dt.TableName = "ViewColumns";
dt.Columns[0].ColumnName = "VIEW_CATALOG";
@@ -221,14 +220,7 @@
dt.Columns.Add("NUMERIC_PRECISION", typeof(byte));
dt.Columns.Add("NUMERIC_SCALE", typeof(Int32));
- try
- {
- GetParametersFromShowCreate(dt, restrictions, routines);
- }
- catch (Exception)
- {
- throw;
- }
+ GetParametersFromShowCreate(dt, restrictions, routines);
return dt;
}
@@ -273,24 +265,17 @@
}
if (where.Length > 0)
- query.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}",
where.ToString());
+ query.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}", where);
return GetTable(query.ToString());
}
private DataTable GetTable(string sql)
{
- try
- {
- DataTable table = new DataTable();
- MySqlDataAdapter da = new MySqlDataAdapter(sql, connection);
- da.Fill(table);
- return table;
- }
- catch (Exception)
- {
- throw;
- }
+ DataTable table = new DataTable();
+ MySqlDataAdapter da = new MySqlDataAdapter(sql, connection);
+ da.Fill(table);
+ return table;
}
#region Procedures Support Rouines
@@ -326,13 +311,8 @@
}
catch (SqlNullValueException snex)
{
- throw new InvalidOperationException(
- Resources.UnableToRetrieveSProcData, snex);
+ throw new
InvalidOperationException(Resources.UnableToRetrieveSProcData, snex);
}
- catch (Exception)
- {
- throw;
- }
finally
{
if (reader != null)
@@ -406,7 +386,7 @@
/// <summary>
/// Initializes a new row for the procedure parameters table.
/// </summary>
- private void InitParameterRow(DataRow procedure, DataRow parameter)
+ private static void InitParameterRow(DataRow procedure, DataRow parameter)
{
parameter["ROUTINE_CATALOG"] = null;
parameter["ROUTINE_SCHEMA"] = procedure["ROUTINE_SCHEMA"];
@@ -420,7 +400,7 @@
/// <summary>
/// Parses out the elements of a procedure parameter data type.
/// </summary>
- private string ParseDataType(DataRow row, SqlTokenizer tokenizer)
+ private static string ParseDataType(DataRow row, SqlTokenizer tokenizer)
{
row["DATA_TYPE"] =
tokenizer.NextToken().ToUpper(CultureInfo.InvariantCulture);
string token = tokenizer.NextToken();
@@ -434,7 +414,7 @@
/// </summary>
/// <returns>True if the token was recognized as a type attribute,
/// false otherwise.</returns>
- private bool SetParameterAttribute(DataRow row, string token, bool isSize,
+ private static bool SetParameterAttribute(DataRow row, string token, bool isSize,
SqlTokenizer tokenizer)
{
string lcDataType =
row["DATA_TYPE"].ToString().ToLower(CultureInfo.InvariantCulture);
Modified: trunk/Driver/Source/Installer.cs
===================================================================
--- trunk/Driver/Source/Installer.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/Installer.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -51,7 +51,7 @@
InstallPerfMonItems();
}
- private void AddProviderToMachineConfig()
+ private static void AddProviderToMachineConfig()
{
object installRoot = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\",
@@ -69,7 +69,7 @@
AddProviderToMachineConfigInDir(installRoot64);
}
- private void AddProviderToMachineConfigInDir(string path)
+ private static void AddProviderToMachineConfigInDir(string path)
{
string configPath = String.Format(@"{0}v2.0.50727\CONFIG\machine.config",
path);
@@ -123,7 +123,7 @@
writer.Close();
}
- private void InstallPerfMonItems()
+ private static void InstallPerfMonItems()
{
string categoryName = Resources.PerfMonCategoryName;
@@ -152,7 +152,7 @@
RemovePerfMonItems();
}
- private void RemoveProviderFromMachineConfig()
+ private static void RemoveProviderFromMachineConfig()
{
object installRoot = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\",
@@ -171,7 +171,7 @@
RemoveProviderFromMachineConfigInDir(installRoot64);
}
- private void RemoveProviderFromMachineConfigInDir(string path)
+ private static void RemoveProviderFromMachineConfigInDir(string path)
{
string configPath = String.Format(@"{0}v2.0.50727\CONFIG\machine.config",
path);
@@ -205,7 +205,7 @@
writer.Close();
}
- private void RemovePerfMonItems()
+ private static void RemovePerfMonItems()
{
string categoryName = Resources.PerfMonCategoryName;
Modified: trunk/Driver/Source/Logger.cs
===================================================================
--- trunk/Driver/Source/Logger.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/Logger.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -38,8 +38,7 @@
if (text.Length > 300)
text = text.Substring(0, 300);
- string msg = String.Format("Executing command {0} with text ='{1}'",
- cmd.ToString(), text);
+ string msg = String.Format("Executing command {0} with text ='{1}'", cmd, text);
//TODO: check this
//Enum.GetName( typeof(DBCmd), cmd ), text );
WriteLine( msg );
Modified: trunk/Driver/Source/MySqlClientFactory.cs
===================================================================
--- trunk/Driver/Source/MySqlClientFactory.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlClientFactory.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -20,7 +20,6 @@
#if !PocketPC
-using System;
using System.Data.Common;
namespace MySql.Data.MySqlClient
Modified: trunk/Driver/Source/MySqlConnectionStringBuilder.cs
===================================================================
--- trunk/Driver/Source/MySqlConnectionStringBuilder.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlConnectionStringBuilder.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -111,6 +111,7 @@
/// <summary>
/// Gets or sets the name of the server.
/// </summary>
+ /// <value>The server.</value>
#if !CF && !MONO
[Category("Connection")]
[Description("Server to connect to")]
@@ -1082,6 +1083,16 @@
propertyDescriptors["Connection Protocol"] = mypd;
}
+ /// <summary>
+ /// Removes the entry with the specified key from the <see
cref="T:System.Data.Common.DbConnectionStringBuilder"></see> instance.
+ /// </summary>
+ /// <param name="keyword">The key of the key/value pair to be removed from
the connection string in this <see
cref="T:System.Data.Common.DbConnectionStringBuilder"></see>.</param>
+ /// <returns>
+ /// true if the key existed within the connection string and was removed; false
if the key did not exist.
+ /// </returns>
+ /// <exception cref="T:System.NotSupportedException">The <see
cref="T:System.Data.Common.DbConnectionStringBuilder"></see> is read-only, or
the <see cref="T:System.Data.Common.DbConnectionStringBuilder"></see> has a
fixed size.</exception>
+ /// <exception cref="T:System.ArgumentNullException">keyword is null
(Nothing in Visual Basic)</exception>
+ /// <PermissionSet><IPermission
class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
PathDiscovery="*AllFiles*"/></PermissionSet>
public override bool Remove(string keyword)
{
// first we need to set this keys value to the default
@@ -1092,6 +1103,16 @@
return base.Remove(keyword);
}
+ /// <summary>
+ /// Retrieves a value corresponding to the supplied key from this <see
cref="T:System.Data.Common.DbConnectionStringBuilder"></see>.
+ /// </summary>
+ /// <param name="keyword">The key of the item to retrieve.</param>
+ /// <param name="value">The value corresponding to the key.</param>
+ /// <returns>
+ /// true if keyword was found within the connection string, false otherwise.
+ /// </returns>
+ /// <exception cref="T:System.ArgumentNullException">keyword contains a
null value (Nothing in Visual Basic).</exception>
+ /// <PermissionSet><IPermission
class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
PathDiscovery="*AllFiles*"/></PermissionSet>
public override bool TryGetValue(string keyword, out object value)
{
try
Modified: trunk/Driver/Source/MySqlError.cs
===================================================================
--- trunk/Driver/Source/MySqlError.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlError.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -18,8 +18,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-
namespace MySql.Data.MySqlClient
{
/// <summary>
Modified: trunk/Driver/Source/MySqlHelper.cs
===================================================================
--- trunk/Driver/Source/MySqlHelper.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlHelper.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -18,7 +18,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
using System.Data;
using MySql.Data.MySqlClient;
Modified: trunk/Driver/Source/MySqlPool.cs
===================================================================
--- trunk/Driver/Source/MySqlPool.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlPool.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -19,11 +19,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using MySql.Data.Common;
using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
using System.Threading;
+using System.Collections.Generic;
+#if CF
+using MySql.Data.Common;
+#endif
namespace MySql.Data.MySqlClient
{
@@ -94,21 +95,6 @@
get { return idlePool.Count > 0; }
}
- /// <summary>
- /// It is assumed that this property will only be used from inside an active
- /// lock.
- /// </summary>
- private bool HasRoomForConnections
- {
- get
- {
- if ((inUsePool.Count + idlePool.Count) == maxSize)
- return false;
- return true;
- }
-
- }
-
#endregion
/// <summary>
Modified: trunk/Driver/Source/MySqlStream.cs
===================================================================
--- trunk/Driver/Source/MySqlStream.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/MySqlStream.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -241,7 +241,7 @@
outStream.WriteByte((byte)(len & 0xff));
outStream.WriteByte((byte)((len >> 8) & 0xff));
outStream.WriteByte((byte)((len >> 16) & 0xff));
- outStream.WriteByte((byte)sequenceByte++);
+ outStream.WriteByte(sequenceByte++);
}
public void SendEmptyPacket()
@@ -261,7 +261,7 @@
byte c = (byte)ReadByte();
if (c < 1 || c > 4)
throw new MySqlException(Resources.IncorrectTransmission);
- return ReadInteger((int)c);
+ return ReadInteger(c);
}
public void SkipBytes(int len)
@@ -404,8 +404,7 @@
while (count > 0)
{
int cntToWrite = (int)Math.Min((outLength - outPos), (ulong)count);
- cntToWrite = (int)Math.Min(
- maxBlockSize - (int)(outPos % (ulong)maxBlockSize), cntToWrite);
+ cntToWrite = Math.Min(maxBlockSize - (int)(outPos % (ulong)maxBlockSize),
cntToWrite);
// if we are at a block border, then we need to send a new header
if ((outPos % (ulong)maxBlockSize) == 0)
@@ -470,10 +469,10 @@
switch (c)
{
- case 251: return (long)-1;
- case 252: return (long)ReadInteger(2);
- case 253: return (long)ReadInteger(3);
- case 254: return (long)ReadInteger(8);
+ case 251: return -1;
+ case 252: return ReadInteger(2);
+ case 253: return ReadInteger(3);
+ case 254: return ReadInteger(8);
default: return c;
}
}
Modified: trunk/Driver/Source/NativeDriver.cs
===================================================================
--- trunk/Driver/Source/NativeDriver.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/NativeDriver.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -22,9 +22,9 @@
using System.Collections;
using System.Diagnostics;
using System.IO;
-using System.Security.Cryptography.X509Certificates;
using MySql.Data.Common;
using MySql.Data.Types;
+using System.Security.Cryptography.X509Certificates;
#if !CF
using System.Net.Security;
using System.Security.Authentication;
@@ -157,9 +157,9 @@
ReadOk(true);
}
- public override void Configure(MySqlConnection connection)
+ public override void Configure(MySqlConnection conn)
{
- base.Configure(connection);
+ base.Configure(conn);
stream.MaxPacketSize = (ulong) maxPacketSize;
}
@@ -193,10 +193,8 @@
}
catch (Exception ex)
{
- throw new MySqlException(
- Resources.UnableToConnectToHost,
- (int) MySqlErrorCode.UnableToConnectToHost,
- ex);
+ throw new MySqlException(Resources.UnableToConnectToHost,
+ (int) MySqlErrorCode.UnableToConnectToHost, ex);
}
if (baseStream == null)
@@ -538,7 +536,7 @@
serverStatus &= ~(ServerStatusFlags.AnotherQuery |
ServerStatusFlags.MoreResults);
affectedRows = (ulong) stream.ReadFieldLength();
- lastInsertId = (long) stream.ReadFieldLength();
+ lastInsertId = stream.ReadFieldLength();
if (version.isAtLeast(4, 1, 0))
{
serverStatus = (ServerStatusFlags) stream.ReadInteger(2);
@@ -611,7 +609,7 @@
public override IMySqlValue ReadColumnValue(int index, MySqlField field,
IMySqlValue valObject)
{
long length = -1;
- bool isNull = false;
+ bool isNull;
if (nullMap != null)
isNull = nullMap[index + 2];
@@ -653,7 +651,7 @@
private MySqlField GetFieldMetaData()
{
- MySqlField field = null;
+ MySqlField field;
if (version.isAtLeast(4, 1, 0))
field = GetFieldMetaData41();
Modified: trunk/Driver/Source/common/NamedPipeStream.cs
===================================================================
--- trunk/Driver/Source/common/NamedPipeStream.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/NamedPipeStream.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -107,7 +107,7 @@
// first read the data into an internal buffer since ReadFile cannot read into a buf
at
// a specified offset
- uint read=0;
+ uint read;
byte[] buf = new Byte[count];
bool result = NativeMethods.ReadFile((IntPtr)pipeHandle, buf,
(uint)count, out read, IntPtr.Zero);
@@ -115,8 +115,7 @@
if (! result)
{
Close();
- throw new MySqlClient.MySqlException(
- Resources.ReadFromStreamFailed, true, null);
+ throw new MySqlException(Resources.ReadFromStreamFailed, true, null);
}
Array.Copy(buf, (int)0, buffer, (int)offset, (int)read);
@@ -166,10 +165,10 @@
byte[] localBuf = new byte[65535];
result = true;
- uint thisWritten;
while (count != 0 && result)
{
- int cnt = Math.Min( count, 65535 );
+ uint thisWritten;
+ int cnt = Math.Min(count, 65535);
Array.Copy( buffer, offset, localBuf, 0, cnt );
result = NativeMethods.WriteFile((IntPtr)pipeHandle, localBuf, (uint)cnt, out
thisWritten, IntPtr.Zero);
bytesWritten += thisWritten;
@@ -181,8 +180,7 @@
if (! result)
{
Close();
- throw new MySqlClient.MySqlException(Resources.WriteToStreamFailed,
- true, null);
+ throw new MySqlException(Resources.WriteToStreamFailed, true, null);
}
if (bytesWritten < count)
throw new IOException("Unable to write entire buffer to stream");
Modified: trunk/Driver/Source/common/NativeMethods.cs
===================================================================
--- trunk/Driver/Source/common/NativeMethods.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/NativeMethods.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -19,7 +19,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using System.Threading;
using System.Runtime.InteropServices;
namespace MySql.Data.Common
Modified: trunk/Driver/Source/common/SHA1.cs
===================================================================
--- trunk/Driver/Source/common/SHA1.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/SHA1.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -19,7 +19,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using System.Text;
namespace MySql.Data.Common
{
@@ -43,7 +42,7 @@
public SHA1Hash()
{
- this.intermediateHash = new uint[SHA1_HASH_SIZE/4];
+ intermediateHash = new uint[SHA1_HASH_SIZE/4];
messageBlock = new byte[64];
Reset();
}
@@ -120,14 +119,13 @@
uint temp; // Temporary word value
uint[] W; // Word sequence
uint A, B, C, D, E; // Word buffers
- int index;
W = new uint[80];
//Initialize the first 16 words in the array W
for (int t = 0; t < 16; t++)
{
- index=t*4;
+ int index=t*4;
W[t] = (uint)messageBlock[index] << 24;
W[t] |= (uint)messageBlock[index + 1] << 16;
W[t] |= (uint)messageBlock[index + 2] << 8;
@@ -195,7 +193,7 @@
messageBlockIndex = 0;
}
- private uint CircularShift(int bits, uint word)
+ private static uint CircularShift(int bits, uint word)
{
return (((word) << (bits)) | ((word) >> (32-(bits))));
}
Modified: trunk/Driver/Source/common/Semaphore.cs
===================================================================
--- trunk/Driver/Source/common/Semaphore.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/Semaphore.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -31,10 +31,8 @@
SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
IntPtr handle = CreateSemaphore(ref sa, initialCount,
maximumCount, null);
- int num2 = Marshal.GetLastWin32Error();
if (handle.Equals(IntPtr.Zero))
{
- int num = Marshal.GetLastWin32Error();
throw new Exception("Unable to create semaphore");
}
base.Handle = handle;
Modified: trunk/Driver/Source/common/SharedMemoryStream.cs
===================================================================
--- trunk/Driver/Source/common/SharedMemoryStream.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/SharedMemoryStream.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -23,8 +23,8 @@
using System.Threading;
using System.IO;
using MySql.Data.MySqlClient;
+using System.Diagnostics;
using Microsoft.Win32.SafeHandles;
-using System.Diagnostics;
namespace MySql.Data.Common
{
@@ -46,9 +46,9 @@
private int connectNumber;
private const uint SYNCHRONIZE = 0x00100000;
- private const uint READ_CONTROL = 0x00020000;
+// private const uint READ_CONTROL = 0x00020000;
private const uint EVENT_MODIFY_STATE = 0x2;
- private const uint EVENT_ALL_ACCESS = 0x001F0003;
+// private const uint EVENT_ALL_ACCESS = 0x001F0003;
private const uint FILE_MAP_WRITE = 0x2;
private const int BUFFERLENGTH = 16004;
@@ -193,7 +193,7 @@
{
try
{
- dataView = (IntPtr)MapViewOfFile(dataMap, FILE_MAP_WRITE, 0, 0,
(IntPtr)(int)BUFFERLENGTH);
+ dataView = MapViewOfFile(dataMap, FILE_MAP_WRITE, 0, 0, (IntPtr)(int)BUFFERLENGTH);
if (dataView == IntPtr.Zero) return true;
return false;
}
Modified: trunk/Driver/Source/common/SocketStream.cs
===================================================================
--- trunk/Driver/Source/common/SocketStream.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/SocketStream.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -34,7 +34,6 @@
private Socket socket;
public SocketStream(AddressFamily addressFamily, SocketType socketType, ProtocolType
protocol)
- : base()
{
socket = new Socket(addressFamily, socketType, protocol);
}
@@ -113,7 +112,7 @@
for (int i=0; i<addr.Size; i++)
buff[i] = addr[i];
- int result = NativeMethods.connect(socket.Handle, buff, addr.Size);
+ NativeMethods.connect(socket.Handle, buff, addr.Size);
int wsaerror = NativeMethods.WSAGetLastError();
if (wsaerror != 10035)
{
Modified: trunk/Driver/Source/common/SqlTokenizer.cs
===================================================================
--- trunk/Driver/Source/common/SqlTokenizer.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/SqlTokenizer.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -1,8 +1,5 @@
using System;
-using System.Collections.Generic;
using System.Text;
-using System.Collections.Specialized;
-using System.IO;
namespace MySql.Data.Common
{
@@ -10,7 +7,7 @@
{
private string input;
private int index;
- private StringBuilder current;
+ //private StringBuilder current;
private bool ansiQuotes;
private bool backslashEscapes;
private bool inSize;
@@ -23,7 +20,7 @@
this.input = input;
index = -1;
backslashEscapes = true;
- current = new StringBuilder();
+ //current = new StringBuilder();
}
#region Properties
Modified: trunk/Driver/Source/common/StreamCreator.cs
===================================================================
--- trunk/Driver/Source/common/StreamCreator.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/StreamCreator.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -22,10 +22,7 @@
using System.IO;
using System.Net;
using System.Net.Sockets;
-using System.Collections;
-using System.Threading;
using System.Reflection;
-using MySql.Data.MySqlClient;
namespace MySql.Data.Common
{
@@ -48,16 +45,16 @@
this.pipeName = pipeName;
}
- public Stream GetStream(uint timeOut)
+ public Stream GetStream(uint timeout)
{
- this.timeOut = timeOut;
+ timeOut = timeout;
if (hostList.StartsWith("/"))
- return CreateSocketStream(null, 0, true);
+ return CreateSocketStream(null, true);
string[] dnsHosts = hostList.Split('&');
- System.Random random = new Random((int)DateTime.Now.Ticks);
+ Random random = new Random((int)DateTime.Now.Ticks);
int index = random.Next(dnsHosts.Length);
int pos = 0;
bool usePipe = (pipeName != null && pipeName.Length != 0);
@@ -83,7 +80,7 @@
if (address.AddressFamily == AddressFamily.InterNetworkV6)
continue;
- stream = CreateSocketStream(address, port, false);
+ stream = CreateSocketStream(address, false);
if (stream != null)
break;
}
@@ -103,7 +100,7 @@
{
IPHostEntry ipHE;
#if !CF
- IPAddress addr = null;
+ IPAddress addr;
if (IPAddress.TryParse(hostname, out addr))
{
ipHE = new IPHostEntry();
@@ -123,11 +120,11 @@
if (0 == String.Compare(hostname, "localhost", true))
pipePath = @"\\.\pipe\" + pipeName;
else
- pipePath = String.Format(@"\\{0}\pipe\{1}", hostname.ToString(), pipeName);
+ pipePath = String.Format(@"\\{0}\pipe\{1}", hostname, pipeName);
return new NamedPipeStream(pipePath, FileAccess.ReadWrite);
}
- private EndPoint CreateUnixEndPoint(string host)
+ private static EndPoint CreateUnixEndPoint(string host)
{
// first we need to load the Mono.posix assembly
#if NET20
@@ -144,7 +141,7 @@
}
#endif
- private Stream CreateSocketStream(IPAddress ip, uint port, bool unix)
+ private Stream CreateSocketStream(IPAddress ip, bool unix)
{
EndPoint endPoint;
#if !CF
@@ -167,7 +164,7 @@
}
socket.EndConnect(ias);
}
- catch (Exception ex)
+ catch (Exception)
{
socket.Close();
return null;
Modified: trunk/Driver/Source/common/Version.cs
===================================================================
--- trunk/Driver/Source/common/Version.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/common/Version.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -82,11 +82,11 @@
return new DBVersion(versionString, major, minor, build);
}
- public bool isAtLeast(int major, int minor, int build)
+ public bool isAtLeast(int majorNum, int minorNum, int buildNum)
{
- if (this.major > major) return true;
- if (this.major == major && this.minor > minor) return true;
- if (this.major == major && this.minor == minor && this.build >=
build) return true;
+ if (major > majorNum) return true;
+ if (major == majorNum && minor > minorNum) return true;
+ if (major == majorNum && minor == minorNum && build >= buildNum)
return true;
return false;
}
Modified: trunk/Driver/Source/parameter.cs
===================================================================
--- trunk/Driver/Source/parameter.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/parameter.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -19,12 +19,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using System.ComponentModel;
using System.Data;
using System.Data.Common;
+using MySql.Data.Types;
+using System.ComponentModel;
using System.Globalization;
using System.Reflection;
-using MySql.Data.Types;
#if !CF
using System.ComponentModel.Design.Serialization;
#endif
@@ -367,9 +367,9 @@
v.WriteValue(stream, binary, paramValue, size);
}
- private void SetMySqlDbType(MySqlDbType mySqlDbType)
+ private void SetMySqlDbType(MySqlDbType mysql_dbtype)
{
- this.mySqlDbType = mySqlDbType;
+ mySqlDbType = mysql_dbtype;
switch (mySqlDbType)
{
case MySqlDbType.Decimal:
@@ -440,9 +440,9 @@
}
- private void SetDbType(DbType dbType)
+ private void SetDbType(DbType db_type)
{
- this.dbType = dbType;
+ dbType = db_type;
switch (dbType)
{
case DbType.Guid:
Modified: trunk/Driver/Source/parameter_collection.cs
===================================================================
--- trunk/Driver/Source/parameter_collection.cs 2007-05-21 14:40:31 UTC (rev 727)
+++ trunk/Driver/Source/parameter_collection.cs 2007-05-21 14:50:24 UTC (rev 728)
@@ -19,7 +19,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using System.Data;
using System.Data.Common;
using System.Collections;
using System.ComponentModel;
@@ -170,7 +169,7 @@
/// <returns></returns>
protected override DbParameter GetParameter(string parameterName)
{
- int index = this.IndexOf(parameterName);
+ int index = IndexOf(parameterName);
if (index < 0)
{
// check to see if the user has added the parameter without a
@@ -195,7 +194,7 @@
protected override void SetParameter(string parameterName, DbParameter value)
{
- int index = this.IndexOf(parameterName);
+ int index = IndexOf(parameterName);
if (index < 0)
throw new ArgumentException("Parameter '" + parameterName + "' not found in the
collection.");
SetParameter(index, value);
@@ -207,7 +206,7 @@
MySqlParameter p = (MySqlParameter)items[index];
indexHash.Remove(p.ParameterName);
- items[index] = (MySqlParameter)value;
+ items[index] = value;
indexHash.Add(value.ParameterName, index);
}
@@ -286,7 +285,7 @@
/// <returns></returns>
public override IEnumerator GetEnumerator()
{
- return ((IEnumerable)items).GetEnumerator();
+ return items.GetEnumerator();
}
/// <summary>
| Thread |
|---|
| • Connector/NET commit: r728 - in trunk/Driver: . Source Source/common | rburnett | 21 May |