Added:
trunk/Driver/MySql.Data.CF.csproj
Modified:
trunk/Driver/MySql.Data.csproj
trunk/Driver/Source/CommandBuilder.cs
trunk/Driver/Source/Connection.cs
trunk/Driver/Source/Exception.cs
trunk/Driver/Source/ISSchemaProvider.cs
trunk/Driver/Source/Logger.cs
trunk/Driver/Source/MySqlConnectionStringBuilder.cs
trunk/Driver/Source/NativeDriver.cs
trunk/Driver/Source/SchemaProvider.cs
trunk/Driver/Source/Types/MetaData.cs
trunk/Driver/Source/Types/MySqlConversionException.cs
trunk/Driver/Source/base/DbConnectionStringBuilder.cs
trunk/Driver/Source/base/DbException.cs
trunk/Driver/Source/command.cs
trunk/Driver/Source/common/BufferedStream.cs
trunk/Driver/Source/common/SqlTokenizer.cs
trunk/Driver/Source/common/StreamCreator.cs
trunk/Driver/Source/dataadapter.cs
trunk/Driver/Source/parameter.cs
trunk/Driver/Source/parameter_collection.cs
trunk/MySQLClient.sln
trunk/TestSuite/Source/AsyncTests.cs
trunk/TestSuite/Source/BaseTest.cs
trunk/TestSuite/Source/BlobTests.cs
trunk/TestSuite/Source/CharacterSetTests.cs
trunk/TestSuite/Source/CommandBuilderTests.cs
trunk/TestSuite/Source/CommandTests.cs
trunk/TestSuite/Source/ConnectionTests.cs
trunk/TestSuite/Source/CultureTests.cs
trunk/TestSuite/Source/DataAdapterTests.cs
trunk/TestSuite/Source/DataReaderTests.cs
trunk/TestSuite/Source/DataTypeTests.cs
trunk/TestSuite/Source/DateTimeTests.cs
trunk/TestSuite/Source/EventTests.cs
trunk/TestSuite/Source/GetSchemaTests.cs
trunk/TestSuite/Source/InterfaceTests.cs
trunk/TestSuite/Source/LanguageTests.cs
trunk/TestSuite/Source/MicroPerfTests.cs
trunk/TestSuite/Source/MySqlHelperTests.cs
trunk/TestSuite/Source/ParameterTests.cs
trunk/TestSuite/Source/PoolingTests.cs
trunk/TestSuite/Source/PreparedStatements.cs
trunk/TestSuite/Source/ProcedureParameters.cs
trunk/TestSuite/Source/SimpleTransactions.cs
trunk/TestSuite/Source/StoredProcedure.cs
trunk/TestSuite/Source/StressTests.cs
trunk/TestSuite/Source/Syntax.cs
trunk/TestSuite/Source/TimeoutAndCancel.cs
Log:
a whole collection (way too many to enumerate) of fixes implemented during compact framework testing.
Added: trunk/Driver/MySql.Data.CF.csproj
===================================================================
--- trunk/Driver/MySql.Data.CF.csproj 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/MySql.Data.CF.csproj 2007-04-13 17:42:53 UTC (rev 674)
@@ -0,0 +1,161 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{587A47FB-C1CC-459D-93B6-179D95E41EFB}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MySql.Data.CF</RootNamespace>
+ <AssemblyName>MySql.Data.CF</AssemblyName>
+ <ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <PlatformFamilyName>PocketPC</PlatformFamilyName>
+ <PlatformID>3C41C503-53EF-4c2a-8DD4-A8217CAD115E</PlatformID>
+ <OSVersion>4.20</OSVersion>
+ <DeployDirSuffix>MySql.Data.CF</DeployDirSuffix>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FormFactorID>
+ </FormFactorID>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;CF; NET20</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;CF; NET20</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Properties\Resources.Designer.cs" />
+ <Compile Include="Source\base\DbConnectionStringBuilder.cs" />
+ <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>
+ </Compile>
+ <Compile Include="Source\common\BufferedStream.cs" />
+ <Compile Include="Source\common\ContextString.cs" />
+ <Compile Include="Source\common\NativeMethods.cs" />
+ <Compile Include="Source\common\Platform.cs" />
+ <Compile Include="Source\common\Semaphore.cs" />
+ <Compile Include="Source\common\SHA1.cs" />
+ <Compile Include="Source\common\SocketStream.cs" />
+ <Compile Include="Source\common\SqlTokenizer.cs" />
+ <Compile Include="Source\common\StreamCreator.cs" />
+ <Compile Include="Source\common\Version.cs" />
+ <Compile Include="Source\common\WinCE.cs" />
+ <Compile Include="Source\CompressedStream.cs" />
+ <Compile Include="Source\Connection.cs">
+ <SubType>Component</SubType>
+ </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" />
+ <Compile Include="Source\Exception.cs" />
+ <Compile Include="Source\Field.cs" />
+ <Compile Include="Source\ISSchemaProvider.cs" />
+ <Compile Include="Source\Logger.cs" />
+ <Compile Include="Source\MySqlConnectionStringBuilder.cs" />
+ <Compile Include="Source\MysqlDefs.cs" />
+ <Compile Include="Source\MySqlError.cs" />
+ <Compile Include="Source\MySqlHelper.cs" />
+ <Compile Include="Source\MySqlPool.cs" />
+ <Compile Include="Source\MySqlPoolManager.cs" />
+ <Compile Include="Source\MySqlStream.cs" />
+ <Compile Include="Source\NativeDriver.cs" />
+ <Compile Include="Source\parameter.cs" />
+ <Compile Include="Source\parameter_collection.cs" />
+ <Compile Include="Source\PreparableStatement.cs" />
+ <Compile Include="Source\ProcedureCache.cs" />
+ <Compile Include="Source\SchemaProvider.cs" />
+ <Compile Include="Source\Statement.cs" />
+ <Compile Include="Source\StoredProcedure.cs" />
+ <Compile Include="Source\transaction.cs" />
+ <Compile Include="Source\Types\MetaData.cs" />
+ <Compile Include="Source\Types\MySqlBinary.cs" />
+ <Compile Include="Source\Types\MySqlBit.cs" />
+ <Compile Include="Source\Types\MySqlByte.cs" />
+ <Compile Include="Source\Types\MySqlConversionException.cs" />
+ <Compile Include="Source\Types\MySqlDateTime.cs" />
+ <Compile Include="Source\Types\MySqlDecimal.cs" />
+ <Compile Include="Source\Types\MySqlDouble.cs" />
+ <Compile Include="Source\Types\MySqlInt16.cs" />
+ <Compile Include="Source\Types\MySqlInt32.cs" />
+ <Compile Include="Source\Types\MySqlInt64.cs" />
+ <Compile Include="Source\Types\MySqlSingle.cs" />
+ <Compile Include="Source\Types\MySqlString.cs" />
+ <Compile Include="Source\Types\MySqlTime.cs" />
+ <Compile Include="Source\Types\MySqlUByte.cs" />
+ <Compile Include="Source\Types\MySqlUInt16.cs" />
+ <Compile Include="Source\Types\MySqlUInt32.cs" />
+ <Compile Include="Source\Types\MySqlUInt64.cs" />
+ <Compile Include="Source\Types\MySqlValue.cs" />
+ <Compile Include="Source\UsageAdvisor.cs" />
+ <Compile Include="Source\zlib\Adler32.cs" />
+ <Compile Include="Source\zlib\Deflate.cs" />
+ <Compile Include="Source\zlib\InfBlocks.cs" />
+ <Compile Include="Source\zlib\InfCodes.cs" />
+ <Compile Include="Source\zlib\Inflate.cs" />
+ <Compile Include="Source\zlib\InfTree.cs" />
+ <Compile Include="Source\zlib\StaticTree.cs" />
+ <Compile Include="Source\zlib\SupportClass.cs" />
+ <Compile Include="Source\zlib\Tree.cs" />
+ <Compile Include="Source\zlib\ZInputStream.cs" />
+ <Compile Include="Source\zlib\Zlib.cs" />
+ <Compile Include="Source\zlib\ZOutputStream.cs" />
+ <Compile Include="Source\zlib\ZStream.cs" />
+ <Compile Include="Source\zlib\ZStreamException.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" />
+ <Import Condition="'$(TargetFrameworkVersion)' == 'v2.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
+ <HostingProcess disable="1" />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Modified: trunk/Driver/MySql.Data.csproj
===================================================================
--- trunk/Driver/MySql.Data.csproj 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/MySql.Data.csproj 2007-04-13 17:42:53 UTC (rev 674)
@@ -214,6 +214,10 @@
<Content Include="docs\MySqlParameter.xml" />
<Content Include="docs\MySqlParameterCollection.xml" />
<Content Include="docs\MySqlTransaction.xml" />
+ <EmbeddedResource Include="Properties\ReservedWords.txt" />
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
<Content Include="Source\docs\MySqlCommand.xml" />
<Content Include="Source\docs\MySqlCommandBuilder.xml" />
<Content Include="Source\docs\MySqlConnection.xml" />
@@ -225,21 +229,10 @@
<Content Include="Source\docs\MySqlParameter.xml" />
<Content Include="Source\docs\MySqlParameterCollection.xml" />
<Content Include="Source\docs\MySqlTransaction.xml" />
- <Content Include="Source\ReservedWords.txt" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Properties\Resources.Designer.cs" />
<Compile Include="Source\common\SqlTokenizer.cs" />
- <Compile Include="Source\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- <EmbeddedResource Include="Source\Resources.resx">
- <Generator>ResxFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <CustomToolNamespace>MySql.Data.MySqlClient</CustomToolNamespace>
- <SubType>Designer</SubType>
- </EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Ovatsus.CSharp.targets" />
<PropertyGroup>
Modified: trunk/Driver/Source/CommandBuilder.cs
===================================================================
--- trunk/Driver/Source/CommandBuilder.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/CommandBuilder.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -31,7 +31,7 @@
namespace MySql.Data.MySqlClient
{
/// <include file='docs/MySqlCommandBuilder.xml' path='docs/class/*'/>
-#if !PocketPC
+#if !CF
[ToolboxItem(false)]
[System.ComponentModel.DesignerCategory("Code")]
#endif
@@ -256,7 +256,8 @@
if (!(bool)row["IsAutoIncrement"])
continue;
- select.AppendFormat("`{0}`", row["ColumnName"]);
+ select.AppendFormat(CultureInfo.InvariantCulture,
+ "`{0}`", row["ColumnName"]);
break;
}
Modified: trunk/Driver/Source/Connection.cs
===================================================================
--- trunk/Driver/Source/Connection.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/Connection.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -31,7 +31,7 @@
namespace MySql.Data.MySqlClient
{
/// <include file='docs/MySqlConnection.xml' path='docs/ClassSummary/*'/>
-#if !PocketPC
+#if !CF
[System.Drawing.ToolboxBitmap(typeof(MySqlConnection), "MySqlClient.resources.connection.bmp")]
[System.ComponentModel.DesignerCategory("Code")]
[ToolboxItem(true)]
@@ -130,7 +130,7 @@
#region Properties
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
internal UsageAdvisor UsageAdvisor
@@ -141,7 +141,7 @@
/// <summary>
/// Returns the id of the server thread this connection is executing on
/// </summary>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public int ServerThread
@@ -152,7 +152,7 @@
/// <summary>
/// Gets the name of the MySQL server to which to connect.
/// </summary>
-#if !PocketPC
+#if !CF
[Browsable(true)]
#endif
public override string DataSource
@@ -161,7 +161,7 @@
}
/// <include file='docs/MySqlConnection.xml' path='docs/ConnectionTimeout/*'/>
-#if !PocketPC
+#if !CF
[Browsable(true)]
#endif
public override int ConnectionTimeout
@@ -170,7 +170,7 @@
}
/// <include file='docs/MySqlConnection.xml' path='docs/Database/*'/>
-#if !PocketPC
+#if !CF
[Browsable(true)]
#endif
public override string Database
@@ -181,7 +181,7 @@
/// <summary>
/// Indicates if this connection should use compression when communicating with the server.
/// </summary>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public bool UseCompression
@@ -190,7 +190,7 @@
}
/// <include file='docs/MySqlConnection.xml' path='docs/State/*'/>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public override ConnectionState State
@@ -199,7 +199,7 @@
}
/// <include file='docs/MySqlConnection.xml' path='docs/ServerVersion/*'/>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public override string ServerVersion
@@ -220,7 +220,7 @@
/// <include file='docs/MySqlConnection.xml' path='docs/ConnectionString/*'/>
-#if !PocketPC
+#if !CF
[Editor("MySql.Data.MySqlClient.Design.ConnectionStringTypeEditor,MySqlClient.Design", typeof(System.Drawing.Design.UITypeEditor))]
[Browsable(true)]
[Category("Data")]
Modified: trunk/Driver/Source/Exception.cs
===================================================================
--- trunk/Driver/Source/Exception.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/Exception.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -20,7 +20,9 @@
using System;
using System.Data.Common;
+#if !CF
using System.Runtime.Serialization;
+#endif
namespace MySql.Data.MySqlClient
{
@@ -28,7 +30,7 @@
/// The exception that is thrown when MySQL returns an error. This class cannot be inherited.
/// </summary>
/// <include file='docs/MySqlException.xml' path='MyDocs/MyMembers[@name="Class"]/*'/>
-#if !PocketPC
+#if !CF
[Serializable]
#endif
public sealed class MySqlException : DbException
@@ -64,7 +66,7 @@
errorCode = errno;
}
-#if !PocketPC
+#if !CF
private MySqlException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
Modified: trunk/Driver/Source/ISSchemaProvider.cs
===================================================================
--- trunk/Driver/Source/ISSchemaProvider.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/ISSchemaProvider.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -359,6 +359,7 @@
while (token != ")")
{
token = tokenizer.NextToken();
+ if (token == ")") break; /* handle the case where there are no parms */
DataRow parmRow = parametersTable.NewRow();
InitParameterRow(row, parmRow);
parmRow["ORDINAL_POSITION"] = pos++;
@@ -436,10 +437,15 @@
private bool SetParameterAttribute(DataRow row, string token, bool isSize,
SqlTokenizer tokenizer)
{
+ string lcDataType = row["DATA_TYPE"].ToString().ToLower(CultureInfo.InvariantCulture);
+
if (isSize)
{
+ // if the data type if set or enum, then nothing to do.
+ if (lcDataType == "enum" || lcDataType == "set") return true;
+
string[] sizeParts = token.Split(new char[] { ',' });
- if (MetaData.IsNumericType(row["DATA_TYPE"].ToString()))
+ if (MetaData.IsNumericType(lcDataType))
row["NUMERIC_PRECISION"] = Int32.Parse(sizeParts[0]);
else
row["CHARACTER_OCTET_LENGTH"] = Int32.Parse(sizeParts[0]);
Modified: trunk/Driver/Source/Logger.cs
===================================================================
--- trunk/Driver/Source/Logger.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/Logger.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -65,14 +65,14 @@
static public void Write(string s)
{
-#if !PocketPC
+#if !CF
Trace.Write(s);
#endif
}
static public void WriteLine(string s)
{
-#if !PocketPC
+#if !CF
Trace.WriteLine(String.Format("[{0}] - {1}",
DateTime.Now, s));
#endif
Modified: trunk/Driver/Source/MySqlConnectionStringBuilder.cs
===================================================================
--- trunk/Driver/Source/MySqlConnectionStringBuilder.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/MySqlConnectionStringBuilder.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -78,7 +78,7 @@
/// <summary>
/// Gets or sets the name of the server.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[Description("Server to connect to")]
#endif
@@ -92,7 +92,7 @@
/// Gets or sets the name of the database the connection should
/// initially connect to.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[Description("Database to use initially")]
#endif
@@ -106,7 +106,7 @@
/// Gets or sets the protocol that should be used for communicating
/// with MySQL.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Connection Protocol")]
[Description("Protocol to use for connection to MySQL")]
@@ -122,7 +122,7 @@
/// Gets or sets the name of the named pipe that should be used
/// for communicating with MySQL.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Pipe Name")]
[Description("Name of pipe to use when connecting with named pipes (Win32 only)")]
@@ -137,7 +137,7 @@
/// Gets or sets a boolean value that indicates whether this connection
/// should use compression.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Use Compression")]
[Description("Should the connection ues compression")]
@@ -153,7 +153,7 @@
/// Gets or sets a boolean value that indicates whether this connection will allow
/// commands to send multiple SQL statements in one execution.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Allow Batch")]
[Description("Allows execution of multiple SQL commands in a single statement")]
@@ -168,7 +168,7 @@
/// <summary>
/// Gets or sets a boolean value that indicates whether logging is enabled.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[Description("Enables output of diagnostic messages")]
[DefaultValue(false)]
@@ -183,7 +183,7 @@
/// Gets or sets the base name of the shared memory objects used to
/// communicate with MySQL when the shared memory protocol is being used.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Shared Memory Name")]
[Description("Name of the shared memory object to use")]
@@ -199,7 +199,7 @@
/// Gets or sets a boolean value that indicates whether this connection uses
/// the old style (@) parameter markers or the new (?) style.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Use Old Syntax")]
[Description("Allows the use of old style @ syntax for parameters")]
@@ -217,7 +217,7 @@
/// <remarks>
/// There is only one valid value for this setting currently.
/// </remarks>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Driver Type")]
[Description("Specifies the type of driver to use for this connection")]
@@ -239,7 +239,7 @@
/// Gets or sets the port number that is used when the socket
/// protocol is being used.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[Description("Port to use for TCP/IP connections")]
[DefaultValue(3306)]
@@ -253,7 +253,7 @@
/// <summary>
/// Gets or sets the connection timeout.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Connection")]
[DisplayName("Connect Timeout")]
[Description("The length of time (in seconds) to wait for a connection " +
@@ -273,7 +273,7 @@
/// <summary>
/// Gets or sets the user id that should be used to connect with.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Security")]
[DisplayName("User ID")]
[Description("Indicates the user ID to be used when connecting to the data source.")]
@@ -287,7 +287,7 @@
/// <summary>
/// Gets or sets the password that should be used to connect with.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Security")]
[Description("Indicates the password to be used when connecting to the data source.")]
#endif
@@ -301,7 +301,7 @@
/// Gets or sets a boolean value that indicates if the password should be persisted
/// in the connection string.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Security")]
[DisplayName("Persist Security Info")]
[Description("When false, security-sensitive information, such as the password, " +
@@ -314,7 +314,7 @@
set { base["Persist Security Info"] = value; persistSI = value; }
}
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Authentication")]
[Description("Should the connection use SSL. This currently has no effect.")]
[DefaultValue(false)]
@@ -332,7 +332,7 @@
/// <summary>
/// Gets or sets a boolean value that indicates if zero date time values are supported.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Allow Zero Datetime")]
[Description("Should zero datetimes be supported")]
@@ -348,7 +348,7 @@
/// Gets or sets a boolean value indicating if zero datetime values should be
/// converted to DateTime.MinValue.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Convert Zero Datetime")]
[Description("Should illegal datetime values be converted to DateTime.MinValue")]
@@ -363,7 +363,7 @@
/// <summary>
/// Gets or sets the character set that should be used for sending queries to the server.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[DisplayName("Character Set")]
[Category("Advanced")]
[Description("Character set this connection should use")]
@@ -377,7 +377,7 @@
/// <summary>
/// Gets or sets a boolean value indicating if the Usage Advisor should be enabled.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Use Usage Advisor")]
[Description("Logs inefficient database operations")]
@@ -392,7 +392,7 @@
/// <summary>
/// Gets or sets the size of the stored procedure cache.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Procedure Cache Size")]
[Description("Indicates how many stored procedures can be cached at one time. " +
@@ -408,7 +408,7 @@
/// <summary>
/// Gets or sets a boolean value indicating if the permon hooks should be enabled.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Use Performance Monitor")]
[Description("Indicates that performance counters should be updated during execution.")]
@@ -423,7 +423,7 @@
/// <summary>
/// Gets or sets a boolean value indicating if calls to Prepare() should be ignored.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Ignore Prepare")]
[Description("Instructs the provider to ignore any attempts to prepare a command.")]
@@ -435,7 +435,7 @@
set { base["Ignore Prepare"] = value; ignorePrepare = value; }
}
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Advanced")]
[DisplayName("Use Procedure Bodies")]
[Description("Indicates if stored procedure bodies will be available for parameter detection.")]
@@ -454,7 +454,7 @@
/// <summary>
/// Gets or sets the lifetime of a pooled connection.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Pooling")]
[DisplayName("Load Balance Timeout")]
[Description("The minimum amount of time (in seconds) for this connection to " +
@@ -470,7 +470,7 @@
/// <summary>
/// Gets or sets a boolean value indicating if connection pooling is enabled.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Pooling")]
[Description("When true, the connection object is drawn from the appropriate " +
"pool, or if necessary, is created and added to the appropriate pool.")]
@@ -485,7 +485,7 @@
/// <summary>
/// Gets the minimum connection pool size.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Pooling")]
[DisplayName("Min Pool Size")]
[Description("The minimum number of connections allowed in the pool.")]
@@ -500,7 +500,7 @@
/// <summary>
/// Gets or sets the maximum connection pool setting.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Pooling")]
[DisplayName("Max Pool Size")]
[Description("The maximum number of connections allowed in the pool.")]
@@ -516,7 +516,7 @@
/// Gets or sets a boolean value indicating if the connection should be reset when retrieved
/// from the pool.
/// </summary>
-#if !PocketPC && !MONO
+#if !CF && !MONO
[Category("Pooling")]
[DisplayName("Connection Reset")]
[Description("When true, indicates the connection state is reset when " +
Modified: trunk/Driver/Source/NativeDriver.cs
===================================================================
--- trunk/Driver/Source/NativeDriver.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/NativeDriver.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -174,7 +174,7 @@
// connect to one of our specified hosts
try
{
-#if !PocketPC
+#if !CF
if (Settings.ConnectionProtocol == MySqlConnectionProtocol.SharedMemory)
{
SharedMemoryStream str = new SharedMemoryStream(Settings.SharedMemoryName);
@@ -189,7 +189,7 @@
pipeName = null;
StreamCreator sc = new StreamCreator(Settings.Server, Settings.Port, pipeName);
baseStream = sc.GetStream(Settings.ConnectionTimeout);
-#if !PocketPC
+#if !CF
}
#endif
if (baseStream == null)
Modified: trunk/Driver/Source/SchemaProvider.cs
===================================================================
--- trunk/Driver/Source/SchemaProvider.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/SchemaProvider.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -672,7 +672,7 @@
dt.Columns.Add(new DataColumn("Reserved Word", typeof(string)));
Stream str = Assembly.GetExecutingAssembly().GetManifestResourceStream(
- "MySql.Data.MySqlClient.ReservedWords.txt");
+ "MySql.Data.MySqlClient.Properties.ReservedWords.txt");
StreamReader sr = new StreamReader(str);
string line = sr.ReadLine();
while (line != null)
@@ -707,11 +707,12 @@
{
StringBuilder sql = new StringBuilder();
StringBuilder where = new StringBuilder();
- sql.AppendFormat("SHOW TABLE STATUS FROM `{0}`",
- restrictions[1]);
+ sql.AppendFormat(CultureInfo.InvariantCulture,
+ "SHOW TABLE STATUS FROM `{0}`", restrictions[1]);
if (restrictions != null && restrictions.Length >= 3 &&
restrictions[2] != null)
- where.AppendFormat(" LIKE '{0}'", restrictions[2]);
+ where.AppendFormat(CultureInfo.InvariantCulture,
+ " LIKE '{0}'", restrictions[2]);
sql.Append(where.ToString());
string table_type = restrictions[1].ToLower() == "information_schema" ?
Modified: trunk/Driver/Source/Types/MetaData.cs
===================================================================
--- trunk/Driver/Source/Types/MetaData.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/Types/MetaData.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -52,7 +52,7 @@
public static MySqlDbType NameToType(string typeName, bool unsigned,
bool realAsFloat, MySqlConnection connection)
{
- switch (typeName)
+ switch (typeName.ToLower(CultureInfo.InvariantCulture))
{
case "char": return MySqlDbType.String;
case "varchar": return MySqlDbType.VarChar;
Modified: trunk/Driver/Source/Types/MySqlConversionException.cs
===================================================================
--- trunk/Driver/Source/Types/MySqlConversionException.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/Types/MySqlConversionException.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -25,7 +25,9 @@
/// <summary>
/// Summary description for MySqlConversionException.
/// </summary>
+#if !CF
[Serializable]
+#endif
public class MySqlConversionException : Exception
{
/// <summary>Ctor</summary>
Modified: trunk/Driver/Source/base/DbConnectionStringBuilder.cs
===================================================================
--- trunk/Driver/Source/base/DbConnectionStringBuilder.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/base/DbConnectionStringBuilder.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -16,11 +16,12 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections;
using System.ComponentModel;
+using System.Text;
namespace MySql.Data.MySqlClient
{
@@ -47,7 +48,12 @@
public string ConnectionString
{
get { return connectionString; }
- set { connectionString = value; }
+ set
+ {
+ Clear();
+ ParseConnectionString(value);
+ connectionString = value;
+ }
}
public virtual object this[string key]
@@ -62,7 +68,7 @@
public void Add(object key, object value)
{
- hash.Add(key, value);
+ hash[key] = value;
//TODO: update connection string
}
@@ -218,5 +224,107 @@
}
#endregion
+
+ private void ParseConnectionString(string connectString)
+ {
+ if (connectString == null) return;
+
+ StringBuilder key = new StringBuilder();
+ StringBuilder value = new StringBuilder();
+ char quoteChar = Char.MinValue;
+ bool keyDone = false;
+ // char lastChar = Char.MinValue;
+
+ foreach (char c in connectString)
+ {
+ if (c == '=')
+ keyDone = true;
+ else if (c == ';')
+ {
+ string keyStr = key.ToString().Trim();
+ string valueStr = value.ToString().Trim();
+ valueStr = CleanValue(valueStr);
+ if (keyStr.Length > 0)
+ this[keyStr] = valueStr;
+ keyDone = false;
+ key.Remove(0, key.Length);
+ value.Remove(0, value.Length);
+ }
+ else if (keyDone)
+ value.Append(c);
+ else
+ key.Append(c);
+ }
+
+ if (key.Length == 0) return;
+ this[key.ToString().Trim()] = CleanValue(value.ToString().Trim());
+ }
+
+ private string CleanValue(string value)
+ {
+ if ((value.StartsWith("'") && value.EndsWith("'")) ||
+ (value.StartsWith("\"") && value.EndsWith("\"")))
+ {
+ value = value.Substring(1);
+ value = value.Substring(0, value.Length - 1);
+ }
+ return value;
+ }
+
+/* private void ParseConnectionString(string value)
+ {
+ String[] keyvalues = src.Split(';');
+ String[] newkeyvalues = new String[keyvalues.Length];
+ int x = 0;
+
+ // first run through the array and check for any keys that
+ // have ; in their value
+ foreach (String keyvalue in keyvalues)
+ {
+ // check for trailing ; at the end of the connection string
+ if (keyvalue.Length == 0) continue;
+
+ // this value has an '=' sign so we are ok
+ if (keyvalue.IndexOf('=') >= 0)
+ {
+ newkeyvalues[x++] = keyvalue;
+ }
+ else
+ {
+ newkeyvalues[x - 1] += ";";
+ newkeyvalues[x - 1] += keyvalue;
+ }
+ }
+
+ Hashtable hash = new Hashtable();
+
+ // now we run through our normalized key-values, splitting on equals
+ for (int y = 0; y < x; y++)
+ {
+ String[] parts = newkeyvalues[y].Split('=');
+
+ // first trim off any space and lowercase the key
+ parts[0] = parts[0].Trim().ToLower();
+ parts[1] = parts[1].Trim();
+
+ // we also want to clear off any quotes
+ if (parts[1].Length >= 2)
+ {
+ if ((parts[1][0] == '"' && parts[1][parts[1].Length - 1] == '"') ||
+ (parts[1][0] == '\'' && parts[1][parts[1].Length - 1] == '\''))
+ {
+ parts[1] = parts[1].Substring(1, parts[1].Length - 2);
+ }
+ }
+ else
+ {
+ parts[1] = parts[1];
+ }
+ parts[0] = parts[0].Trim('\'', '"');
+
+ hash[parts[0]] = parts[1];
+ }
+ return hash;
+ }*/
}
}
Modified: trunk/Driver/Source/base/DbException.cs
===================================================================
--- trunk/Driver/Source/base/DbException.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/base/DbException.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -49,10 +49,10 @@
#region Properties
- public int ErrorCode
- {
- get { return errorCode; }
- }
+// public int ErrorCode
+ // {
+ // get { return errorCode; }
+ // }
#endregion
Modified: trunk/Driver/Source/command.cs
===================================================================
--- trunk/Driver/Source/command.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/command.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -33,7 +33,7 @@
namespace MySql.Data.MySqlClient
{
/// <include file='docs/mysqlcommand.xml' path='docs/ClassSummary/*'/>
-#if !PocketPC
+#if !CF
[System.Drawing.ToolboxBitmap(typeof(MySqlCommand), "MySqlClient.resources.command.bmp")]
[System.ComponentModel.DesignerCategory("Code")]
#endif
@@ -103,7 +103,7 @@
/// <include file='docs/mysqlcommand.xml' path='docs/LastInseredId/*'/>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public Int64 LastInsertedId
@@ -112,7 +112,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/CommandText/*'/>
-#if !PocketPC
+#if !CF
[Category("Data")]
[Description("Command text to execute")]
[Editor("MySql.Data.Common.Design.SqlCommandTextEditor,MySqlClient.Design", typeof(System.Drawing.Design.UITypeEditor))]
@@ -139,7 +139,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/CommandTimeout/*'/>
-#if !PocketPC
+#if !CF
[Category("Misc")]
[Description("Time to wait for command to execute")]
[DefaultValue(30)]
@@ -151,7 +151,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/CommandType/*'/>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public override CommandType CommandType
@@ -161,7 +161,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/IsPrepared/*'/>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public bool IsPrepared
@@ -170,7 +170,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/Connection/*'/>
-#if !PocketPC
+#if !CF
[Category("Behavior")]
[Description("Connection used by the command")]
#endif
@@ -194,7 +194,7 @@
}
/// <include file='docs/mysqlcommand.xml' path='docs/Parameters/*'/>
-#if !PocketPC
+#if !CF
[Category("Data")]
[Description("The parameters collection")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
@@ -206,7 +206,7 @@
/// <include file='docs/mysqlcommand.xml' path='docs/Transaction/*'/>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public new MySqlTransaction Transaction
@@ -216,7 +216,7 @@
}
/* /// <include file='docs/mysqlcommand.xml' path='docs/UpdatedRowSource/*'/>
- #if !PocketPC
+ #if !CF
[Category("Behavior")]
#endif
public override UpdateRowSource UpdatedRowSource
@@ -714,7 +714,7 @@
/// <summary>
/// Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.
/// </summary>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public override bool DesignTimeVisible
Modified: trunk/Driver/Source/common/BufferedStream.cs
===================================================================
--- trunk/Driver/Source/common/BufferedStream.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/common/BufferedStream.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -38,6 +38,8 @@
{
baseStream = stream;
bufferSize = 4096;
+ readBuffer = new byte[bufferSize];
+ writeBuffer = new byte[bufferSize];
}
#region Stream Implementation
@@ -169,10 +171,6 @@
if (baseStream == null)
throw new InvalidOperationException(Resources.ObjectDisposed);
- // if we have not created our write buffer yet, then do so now
- if (writeBuffer == null)
- writeBuffer = new byte[bufferSize];
-
// if we don't have enough room in our current write buffer for the data
// then flush the data
int roomLeft = bufferSize - writePos;
@@ -183,11 +181,13 @@
// We just send it down
if (count > bufferSize)
baseStream.Write(buffer, offset, count);
-
- // if we get here then there is room in our buffer for the data. We store it and
- // adjust our internal lengths.
- Buffer.BlockCopy (buffer, offset, writeBuffer, writePos, count);
- writePos += count;
+ else
+ {
+ // if we get here then there is room in our buffer for the data. We store it and
+ // adjust our internal lengths.
+ Buffer.BlockCopy(buffer, offset, writeBuffer, writePos, count);
+ writePos += count;
+ }
}
#endregion
Modified: trunk/Driver/Source/common/SqlTokenizer.cs
===================================================================
--- trunk/Driver/Source/common/SqlTokenizer.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/common/SqlTokenizer.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -62,7 +62,7 @@
bool inLineComment = false;
quoted = isSize = false;
- while (true)
+ while ((index+1) < input.Length)
{
char c = input[++index];
@@ -128,6 +128,7 @@
current.Append(c);
lastChar = c;
}
+ return null;
}
}
Modified: trunk/Driver/Source/common/StreamCreator.cs
===================================================================
--- trunk/Driver/Source/common/StreamCreator.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/common/StreamCreator.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -29,80 +29,81 @@
namespace MySql.Data.Common
{
- /// <summary>
- /// Summary description for StreamCreator.
- /// </summary>
- internal class StreamCreator
- {
- string hostList;
- uint port;
- string pipeName;
- uint timeOut;
+ /// <summary>
+ /// Summary description for StreamCreator.
+ /// </summary>
+ internal class StreamCreator
+ {
+ string hostList;
+ uint port;
+ string pipeName;
+ uint timeOut;
- public StreamCreator(string hosts, uint port, string pipeName)
- {
- hostList = hosts;
- if (hostList == null || hostList.Length == 0)
- hostList = "localhost";
- this.port = port;
- this.pipeName = pipeName;
- }
+ public StreamCreator(string hosts, uint port, string pipeName)
+ {
+ hostList = hosts;
+ if (hostList == null || hostList.Length == 0)
+ hostList = "localhost";
+ this.port = port;
+ this.pipeName = pipeName;
+ }
- public Stream GetStream(uint timeOut)
- {
- this.timeOut = timeOut;
+ public Stream GetStream(uint timeOut)
+ {
+ this.timeOut = timeOut;
- if (hostList.StartsWith("/"))
- return CreateSocketStream(null, 0, true);
+ if (hostList.StartsWith("/"))
+ return CreateSocketStream(null, 0, true);
- string[] dnsHosts = hostList.Split('&');
+ string[] dnsHosts = hostList.Split('&');
- System.Random random = new Random((int)DateTime.Now.Ticks);
- int index = random.Next(dnsHosts.Length);
- int pos = 0;
- bool usePipe = (pipeName != null && pipeName.Length != 0);
- Stream stream = null;
+ System.Random random = new Random((int)DateTime.Now.Ticks);
+ int index = random.Next(dnsHosts.Length);
+ int pos = 0;
+ bool usePipe = (pipeName != null && pipeName.Length != 0);
+ Stream stream = null;
- while (pos < dnsHosts.Length)
- {
+ while (pos < dnsHosts.Length)
+ {
#if !CF
if (usePipe)
stream = CreateNamedPipeStream(dnsHosts[index]);
else
#endif
- {
+ {
#if NET20
IPHostEntry ipHE = GetHostEntry(dnsHosts[index]);
#else
IPHostEntry ipHE = Dns.GetHostByName(dnsHosts[index]);
#endif
- foreach (IPAddress address in ipHE.AddressList)
- {
- // MySQL doesn't currently support IPv6 addresses
- if (address.AddressFamily == AddressFamily.InterNetworkV6)
- continue;
+ foreach (IPAddress address in ipHE.AddressList)
+ {
+ // MySQL doesn't currently support IPv6 addresses
+ if (address.AddressFamily == AddressFamily.InterNetworkV6)
+ continue;
- stream = CreateSocketStream(address, port, false);
- if (stream != null)
- break;
- }
- }
- if (stream != null)
- break;
- index++;
- if (index == dnsHosts.Length)
- index = 0;
- pos++;
- }
+ stream = CreateSocketStream(address, port, false);
+ if (stream != null)
+ break;
+ }
+ }
+ if (stream != null)
+ break;
+ index++;
+ if (index == dnsHosts.Length)
+ index = 0;
+ pos++;
+ }
- return stream;
- }
+ return stream;
+ }
private IPHostEntry GetHostEntry(string hostname)
{
+ IPHostEntry ipHE;
+#if !CF
IPAddress addr = null;
- IPHostEntry ipHE;
if (IPAddress.TryParse(hostname, out addr))
{
ipHE = new IPHostEntry();
@@ -110,7 +111,8 @@
ipHE.AddressList[0] = addr;
}
else
- ipHE = Dns.GetHostEntry(hostname);
+#endif
+ ipHE = Dns.GetHostEntry(hostname);
return ipHE;
}
@@ -143,35 +145,35 @@
#endif
private Stream CreateSocketStream(IPAddress ip, uint port, bool unix)
- {
- EndPoint endPoint;
+ {
+ EndPoint endPoint;
#if !CF
if (!Platform.IsWindows() && unix)
endPoint = CreateUnixEndPoint(hostList);
else
#endif
- endPoint = new IPEndPoint(ip, (int)port);
+ endPoint = new IPEndPoint(ip, (int)port);
- Socket socket = unix ?
- new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.IP) :
- new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- IAsyncResult ias = socket.BeginConnect(endPoint, null, null);
- if (!ias.AsyncWaitHandle.WaitOne((int)timeOut * 1000, true))
- {
- socket.Close();
- return null;
- }
- try
- {
- socket.EndConnect(ias);
- }
- catch (Exception)
- {
- socket.Close();
- return null;
- }
- return new NetworkStream(socket, true);
- }
+ Socket socket = unix ?
+ new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.IP) :
+ new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ try
+ {
+ IAsyncResult ias = socket.BeginConnect(endPoint, null, null);
+ if (!ias.AsyncWaitHandle.WaitOne((int)timeOut * 1000, false))
+ {
+ socket.Close();
+ return null;
+ }
+ socket.EndConnect(ias);
+ }
+ catch (Exception ex)
+ {
+ socket.Close();
+ return null;
+ }
+ return new NetworkStream(socket, true);
+ }
- }
+ }
}
Modified: trunk/Driver/Source/dataadapter.cs
===================================================================
--- trunk/Driver/Source/dataadapter.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/dataadapter.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -26,7 +26,7 @@
namespace MySql.Data.MySqlClient
{
/// <include file='docs/MySqlDataAdapter.xml' path='docs/class/*'/>
-#if !PocketPC
+#if !CF
[System.Drawing.ToolboxBitmap( typeof(MySqlDataAdapter), "MySqlClient.resources.dataadapter.bmp")]
[System.ComponentModel.DesignerCategory("Code")]
[Designer("MySql.Data.MySqlClient.Design.MySqlDataAdapterDesigner,MySqlClient.Design")]
@@ -79,7 +79,7 @@
#region Properties
/// <include file='docs/MySqlDataAdapter.xml' path='docs/DeleteCommand/*'/>
-#if !PocketPC
+#if !CF
[Description("Used during Update for deleted rows in Dataset.")]
#endif
public new MySqlCommand DeleteCommand
@@ -89,7 +89,7 @@
}
/// <include file='docs/MySqlDataAdapter.xml' path='docs/InsertCommand/*'/>
-#if !PocketPC
+#if !CF
[Description("Used during Update for new rows in Dataset.")]
#endif
public new MySqlCommand InsertCommand
@@ -99,7 +99,7 @@
}
/// <include file='docs/MySqlDataAdapter.xml' path='docs/SelectCommand/*'/>
-#if !PocketPC
+#if !CF
[Description("Used during Fill/FillSchema")]
[Category("Fill")]
#endif
@@ -110,7 +110,7 @@
}
/// <include file='docs/MySqlDataAdapter.xml' path='docs/UpdateCommand/*'/>
-#if !PocketPC
+#if !CF
[Description("Used during Update for modified rows in Dataset.")]
#endif
public new MySqlCommand UpdateCommand
Modified: trunk/Driver/Source/parameter.cs
===================================================================
--- trunk/Driver/Source/parameter.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/parameter.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -25,7 +25,7 @@
using System.Reflection;
using MySql.Data.Types;
using MySql.Data.Common;
-#if !PocketPC
+#if !CF
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
#endif
@@ -35,7 +35,7 @@
/// <summary>
/// Represents a parameter to a <see cref="MySqlCommand"/>, and optionally, its mapping to <see cref="DataSet"/> columns. This class cannot be inherited.
/// </summary>
-#if !PocketPC
+#if !CF
[TypeConverter(typeof(MySqlParameter.MySqlParameterConverter))]
#endif
public sealed class MySqlParameter : DbParameter, IDataParameter, IDbDataParameter, ICloneable
@@ -188,7 +188,7 @@
/// Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.
/// As of MySql version 4.1 and earlier, input-only is the only valid choice.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public override ParameterDirection Direction
@@ -200,7 +200,7 @@
/// <summary>
/// Gets or sets a value indicating whether the parameter accepts null values.
/// </summary>
-#if !PocketPC
+#if !CF
[Browsable(false)]
#endif
public override Boolean IsNullable
@@ -212,7 +212,7 @@
/// <summary>
/// Gets or sets the MySqlDbType of the parameter.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public MySqlDbType MySqlDbType
@@ -228,7 +228,7 @@
/// <summary>
/// Gets or sets the name of the MySqlParameter.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Misc")]
#endif
public override String ParameterName
@@ -245,7 +245,7 @@
/// <summary>
/// Gets or sets the maximum number of digits used to represent the <see cref="Value"/> property.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public byte Precision
@@ -257,7 +257,7 @@
/// <summary>
/// Gets or sets the number of decimal places to which <see cref="Value"/> is resolved.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public byte Scale
@@ -269,7 +269,7 @@
/// <summary>
/// Gets or sets the maximum size, in bytes, of the data within the column.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public override int Size
@@ -281,7 +281,7 @@
/// <summary>
/// Gets or sets the name of the source column that is mapped to the <see cref="DataSet"/> and used for loading or returning the <see cref="Value"/>.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public override String SourceColumn
@@ -293,7 +293,7 @@
/// <summary>
/// Gets or sets the <see cref="DataRowVersion"/> to use when loading <see cref="Value"/>.
/// </summary>
-#if !PocketPC
+#if !CF
[Category("Data")]
#endif
public override DataRowVersion SourceVersion
@@ -305,7 +305,7 @@
/// <summary>
/// Gets or sets the value of the parameter.
/// </summary>
-#if !PocketPC
+#if !CF
[TypeConverter(typeof(StringConverter))]
[Category("Data")]
#endif
@@ -494,7 +494,7 @@
}
#endregion
-#if !PocketPC
+#if !CF
internal class MySqlParameterConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Modified: trunk/Driver/Source/parameter_collection.cs
===================================================================
--- trunk/Driver/Source/parameter_collection.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/Driver/Source/parameter_collection.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -30,7 +30,7 @@
/// Represents a collection of parameters relevant to a <see cref="MySqlCommand"/> as well as their respective mappings to columns in a <see cref="DataSet"/>. This class cannot be inherited.
/// </summary>
/// <include file='docs/MySqlParameterCollection.xml' path='MyDocs/MyMembers[@name="Class"]/*'/>
-#if !PocketPC
+#if !CF
[Editor("MySql.Data.MySqlClient.Design.DBParametersEditor,MySql.Design", typeof(System.Drawing.Design.UITypeEditor))]
[ListBindable(true)]
#endif
Modified: trunk/MySQLClient.sln
===================================================================
--- trunk/MySQLClient.sln 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/MySQLClient.sln 2007-04-13 17:42:53 UTC (rev 674)
@@ -36,12 +36,6 @@
{DC3517FF-AC26-4755-9B7A-EF658FF69593} = {DC3517FF-AC26-4755-9B7A-EF658FF69593}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Samples\Pocket PC\Tester\Tester.csproj", "{586DC799-0E59-4494-8E95-FC554E3A8D25}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
-EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = MySQLClient.2005.vsmdi
@@ -478,70 +472,6 @@
{F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Release|Build All Platforms Simultaneously.ActiveCfg = Commercial|Any CPU
{F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Release|x64.ActiveCfg = Commercial|Any CPU
{F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Release|x86.ActiveCfg = Commercial|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET 1.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET 1.1.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET 1.1 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET 2.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET 2.0 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET CF 1.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET CF 1.0 (Smartphone 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET CF 2.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|.NET CF 2.0 (Windows CE 5.0).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|Any CPU.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|Any CPU.Build.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|Any CPU.Deploy.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|Build All 2.0 Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|Build All Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|x64.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Commercial|x86.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET 1.0.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET 1.1.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET 1.1 (Mono Libraries).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET 2.0.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET 2.0 (Mono Libraries).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET CF 1.0 (Pocket PC 2003).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET CF 1.0 (Smartphone 2003).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET CF 2.0 (Pocket PC 2003).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|.NET CF 2.0 (Windows CE 5.0).ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|Build All 2.0 Platforms Simultaneously.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|Build All Platforms Simultaneously.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|x64.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Debug|x86.ActiveCfg = Debug|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET 1.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET 1.1.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET 1.1 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET 2.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET 2.0 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET CF 1.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET CF 1.0 (Smartphone 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET CF 2.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|.NET CF 2.0 (Windows CE 5.0).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|Any CPU.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|Any CPU.Build.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|Any CPU.Deploy.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|Build All 2.0 Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|Build All Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|x64.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.GPL|x86.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET 1.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET 1.1.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET 1.1 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET 2.0.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET 2.0 (Mono Libraries).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET CF 1.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET CF 1.0 (Smartphone 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET CF 2.0 (Pocket PC 2003).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|.NET CF 2.0 (Windows CE 5.0).ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|Any CPU.Build.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|Build All 2.0 Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|Build All Platforms Simultaneously.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|x64.ActiveCfg = Release|Any CPU
- {586DC799-0E59-4494-8E95-FC554E3A8D25}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/TestSuite/Source/AsyncTests.cs
===================================================================
--- trunk/TestSuite/Source/AsyncTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/AsyncTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -40,10 +40,11 @@
Close();
}
- [Category("5.0")]
[Test]
public void ExecuteNonQuery()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id int)");
execSQL("CREATE PROCEDURE spTest() BEGIN SET @x=0; REPEAT INSERT INTO test VALUES(@x); " +
@@ -77,10 +78,11 @@
}
}
- [Category("5.0")]
[Test]
public void ExecuteReader()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id int)");
execSQL("CREATE PROCEDURE spTest() BEGIN SET @x=0; REPEAT INSERT INTO test VALUES(@x); " +
Modified: trunk/TestSuite/Source/BaseTest.cs
===================================================================
--- trunk/TestSuite/Source/BaseTest.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/BaseTest.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -43,6 +43,7 @@
protected string[] databases;
protected string rootUser;
protected string rootPassword;
+ protected Version version;
public BaseTest()
{
@@ -57,10 +58,10 @@
port = 3306;
pipeName = "MYSQL";
memoryName = "MYSQL";
- rootUser = "su";
- rootPassword = "su";
+ rootUser = "root";
+ rootPassword = "";
-#if NET20 || NET_CF_2_0
+#if NET20
string strHost = ConfigurationManager.AppSettings["host"];
string strPort = ConfigurationManager.AppSettings["port"];
string strDatabase = ConfigurationManager.AppSettings["database"];
@@ -97,6 +98,16 @@
memoryName = strMemName;
}
+ #region Properties
+
+ protected Version Version
+ {
+ get { return version; }
+ }
+
+ #endregion
+
+
protected virtual string GetConnectionInfo()
{
return String.Format("protocol=tcp;port={0}", port);
@@ -131,10 +142,25 @@
string connString = GetConnectionString(true);
conn = new MySqlConnection(connString);
conn.Open();
+
+
+ string ver = conn.ServerVersion;
+
+ int x = 0;
+ foreach (char c in ver)
+ {
+ if (!Char.IsDigit(c) && c != '.')
+ break;
+ x++;
+ }
+ ver = ver.Substring(0, x);
+ version = new Version(ver);
}
catch (Exception ex)
{
+#if !CF
System.Diagnostics.Trace.WriteLine(ex.Message);
+#endif
throw;
}
}
@@ -155,34 +181,6 @@
}
}
- protected bool Is51
- {
- get
- {
- string v = conn.ServerVersion;
- return v.StartsWith("5.1");
- }
- }
-
- protected bool Is50
- {
- get
- {
- string v = conn.ServerVersion;
- return v.StartsWith("5.0") || v.StartsWith("5.1");
- }
- }
-
- protected bool Is41
- {
- get { return conn.ServerVersion.StartsWith("4.1"); }
- }
-
- protected bool Is40
- {
- get { return conn.ServerVersion.StartsWith("4.0"); }
- }
-
[SetUp]
protected virtual void Setup()
{
@@ -193,7 +191,7 @@
reader.Close();
if (exists)
execSQL("TRUNCATE TABLE Test");
- if (Is50)
+ if (Version >= new Version(5,0))
{
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("DROP FUNCTION IF EXISTS fnTest");
@@ -208,7 +206,7 @@
[TearDown]
protected virtual void Teardown()
{
- if (Is50)
+ if (Version >= new Version(5, 0))
{
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("DROP FUNCTION IF EXISTS fnTest");
@@ -232,7 +230,7 @@
protected void createTable(string sql, string engine)
{
- if (Is41 || Is50)
+ if (Version >= new Version(4,1))
sql += " ENGINE=" + engine;
else
sql += " TYPE=" + engine;
Modified: trunk/TestSuite/Source/BlobTests.cs
===================================================================
--- trunk/TestSuite/Source/BlobTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/BlobTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -44,6 +44,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -53,10 +54,9 @@
}
[Test]
- [Category("4.0")]
public void InsertBinary()
{
- int lenIn = 400000;
+ int lenIn = 400000;
byte[] dataIn = Utils.CreateBlob(lenIn);
@@ -131,17 +131,17 @@
}
[Test]
- [Category("4.0")]
public void GetChars()
{
InternalGetChars(false);
}
[Test]
- [Category("4.1")]
public void GetCharsPrepared()
{
- InternalGetChars(true);
+ if (version < new Version(4, 1)) return;
+
+ InternalGetChars(true);
}
private void InternalGetChars(bool prepare)
@@ -202,10 +202,11 @@
}
[Test]
- [Category("4.1")]
public void InsertTextPrepared()
{
- InternalInsertText(true);
+ if (version < new Version(4, 1)) return;
+
+ InternalInsertText(true);
}
private void InternalInsertText(bool prepare)
@@ -302,7 +303,6 @@
}
[Test]
- [Category("4.0")]
public void GetCharsOnLongTextColumn()
{
execSQL("INSERT INTO Test (id, text1) VALUES(1, 'Test')");
@@ -407,7 +407,7 @@
}
#region Configs
-
+#if !CF
[Category("Compressed")]
public class BlobTestsSocketCompressed : BlobTests
{
@@ -454,7 +454,7 @@
return String.Format("protocol=memory; shared memory name={0};compress=true", memoryName);
}
}
-
+#endif
#endregion
}
\ No newline at end of file
Modified: trunk/TestSuite/Source/CharacterSetTests.cs
===================================================================
--- trunk/TestSuite/Source/CharacterSetTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/CharacterSetTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -58,9 +58,10 @@
-
+
+
@@ -84,10 +85,11 @@
-
+
+
@@ -104,8 +106,7 @@
-
-
+
@@ -122,7 +123,7 @@
-
+
Modified: trunk/TestSuite/Source/CommandBuilderTests.cs
===================================================================
--- trunk/TestSuite/Source/CommandBuilderTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/CommandBuilderTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -39,6 +39,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -178,10 +179,11 @@
/// Bug #8382 Commandbuilder does not handle queries to other databases than the default one-
/// </summary>
[Test]
- [Category("4.1")]
public void DifferentDatabase()
{
- execSQL("INSERT INTO test (id, name) VALUES (1,'test1')");
+ if (Version < new Version(4, 1)) return;
+
+ execSQL("INSERT INTO test (id, name) VALUES (1,'test1')");
execSQL("INSERT INTO test (id, name) VALUES (2,'test2')");
execSQL("INSERT INTO test (id, name) VALUES (3,'test3')");
Modified: trunk/TestSuite/Source/CommandTests.cs
===================================================================
--- trunk/TestSuite/Source/CommandTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/CommandTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -42,6 +42,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -233,10 +234,11 @@
/// <summary>
/// Bug #12245 using Prepare() on an insert command causes null parameters to convert to "0"
/// </summary>
- [Category("4.1")]
[Test]
public void InsertingPreparedNulls()
{
+ if (Version < new Version(4, 1)) return;
+
execSQL("TRUNCATE TABLE test");
MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES(1, ?str)", conn);
cmd.Parameters.Add("?str", MySqlDbType.VarChar);
@@ -266,11 +268,12 @@
/// <summary>
/// MySQL Bugs: #12163: Insert using prepared statement causes double insert
/// </summary>
- [Category("4.1")]
[Test]
public void PreparedInsertUsingReader()
{
- execSQL("TRUNCATE TABLE test");
+ if (Version < new Version(4, 1)) return;
+
+ execSQL("TRUNCATE TABLE test");
MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES(1, 'Test')", conn);
cmd.Prepare();
MySqlDataReader reader = cmd.ExecuteReader();
@@ -298,8 +301,7 @@
/// <summary>
/// Bug# 8119. Unable to reproduce but left in anyway
/// </summary>
- [Category("NotWorking")]
- [Test]
+/* [Test]
public void ReallyBigCommandString()
{
System.Text.StringBuilder sql = new System.Text.StringBuilder();
@@ -335,7 +337,7 @@
}
}
-
+*/
/// <summary>
/// Bug #7248 There is already an open DataReader associated with this Connection which must
/// </summary>
@@ -420,7 +422,6 @@
#region Configs
- [Category("Compressed")]
public class CommandTestsSocketCompressed : CommandTests
{
protected override string GetConnectionInfo()
@@ -429,6 +430,7 @@
}
}
+#if !CF
[Category("Pipe")]
public class CommandTestsPipe : CommandTests
{
@@ -466,7 +468,7 @@
return String.Format("protocol=memory; shared memory name={0};compress=true", memoryName);
}
}
-
+#endif
#endregion
}
Modified: trunk/TestSuite/Source/ConnectionTests.cs
===================================================================
--- trunk/TestSuite/Source/ConnectionTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/ConnectionTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -26,250 +26,262 @@
namespace MySql.Data.MySqlClient.Tests
{
- /// <summary>
- /// Summary description for ConnectionTests.
- /// </summary>
- [TestFixture]
- public class ConnectionTests : BaseTest
- {
- [TestFixtureSetUp]
- public void FixtureSetup()
- {
- Open();
- }
+ /// <summary>
+ /// Summary description for ConnectionTests.
+ /// </summary>
+ [TestFixture]
+ public class ConnectionTests : BaseTest
+ {
+ [TestFixtureSetUp]
+ public void FixtureSetup()
+ {
+ Open();
+ }
- [TestFixtureTearDown]
- public void FixtureTearDown()
- {
- Close();
- }
+ [TestFixtureTearDown]
+ public void FixtureTearDown()
+ {
+ Close();
+ }
- [Test]
- public void TestConnectionStrings()
- {
- MySqlConnection c = new MySqlConnection();
+ [Test]
+ public void TestConnectionStrings()
+ {
+ MySqlConnection c = new MySqlConnection();
- // public properties
- Assert.AreEqual(15, c.ConnectionTimeout, "ConnectionTimeout");
- Assert.AreEqual("", c.Database, "Database");
- Assert.AreEqual(String.Empty, c.DataSource, "DataSource");
- Assert.AreEqual(false, c.UseCompression, "Use Compression");
- Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
+ // public properties
+ Assert.AreEqual(15, c.ConnectionTimeout, "ConnectionTimeout");
+ Assert.AreEqual("", c.Database, "Database");
+ Assert.AreEqual(String.Empty, c.DataSource, "DataSource");
+ Assert.AreEqual(false, c.UseCompression, "Use Compression");
+ Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
- c = new MySqlConnection("connection timeout=25; user id=myuser; " +
- "password=mypass; database=Test;server=myserver; use compression=true; " +
- "pooling=false;min pool size=5; max pool size=101");
- // public properties
- Assert.AreEqual(25, c.ConnectionTimeout, "ConnectionTimeout");
- Assert.AreEqual("Test", c.Database, "Database");
- Assert.AreEqual("myserver", c.DataSource, "DataSource");
- Assert.AreEqual(true, c.UseCompression, "Use Compression");
- Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
+ c = new MySqlConnection("connection timeout=25; user id=myuser; " +
+ "password=mypass; database=Test;server=myserver; use compression=true; " +
+ "pooling=false;min pool size=5; max pool size=101");
+ // public properties
+ Assert.AreEqual(25, c.ConnectionTimeout, "ConnectionTimeout");
+ Assert.AreEqual("Test", c.Database, "Database");
+ Assert.AreEqual("myserver", c.DataSource, "DataSource");
+ Assert.AreEqual(true, c.UseCompression, "Use Compression");
+ Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
- c.ConnectionString = "connection timeout=15; user id=newuser; " +
- "password=newpass; port=3308; database=mydb; data source=myserver2; " +
- "use compression=true; pooling=true; min pool size=3; max pool size=76";
+ c.ConnectionString = "connection timeout=15; user id=newuser; " +
+ "password=newpass; port=3308; database=mydb; data source=myserver2; " +
+ "use compression=true; pooling=true; min pool size=3; max pool size=76";
- // public properties
- Assert.AreEqual(15, c.ConnectionTimeout, "ConnectionTimeout");
- Assert.AreEqual("mydb", c.Database, "Database");
- Assert.AreEqual("myserver2", c.DataSource, "DataSource");
- Assert.AreEqual(true, c.UseCompression, "Use Compression");
- Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
- }
+ // public properties
+ Assert.AreEqual(15, c.ConnectionTimeout, "ConnectionTimeout");
+ Assert.AreEqual("mydb", c.Database, "Database");
+ Assert.AreEqual("myserver2", c.DataSource, "DataSource");
+ Assert.AreEqual(true, c.UseCompression, "Use Compression");
+ Assert.AreEqual(System.Data.ConnectionState.Closed, c.State, "State");
+ }
- [Test]
- [ExpectedException(typeof(MySqlException))]
- public void TestConnectingSocketBadUserName()
- {
- execSQL("DELETE FROM mysql.user WHERE length(user) = 0");
- execSQL("FLUSH PRIVILEGES");
+ [Test]
+ public void TestConnectingSocketBadUserName()
+ {
+ suExecSQL("DELETE FROM mysql.user WHERE length(user) = 0");
+ suExecSQL("FLUSH PRIVILEGES");
- string connStr = "server={0};user id=dummy;password=;database=Test;pooling=false";
- MySqlConnection c = new MySqlConnection(
- String.Format(connStr, host));
- c.Open();
- c.Close();
- }
+ string connStr = "server={0};user id=dummy;password=;database=Test;pooling=false";
+ MySqlConnection c = new MySqlConnection(
+ String.Format(connStr, host));
+ try
+ {
+ c.Open();
+ c.Close();
+ throw new Exception("Open should not have worked");
+ }
+ catch (MySqlException)
+ {
+ }
+ }
- [Test]
- [ExpectedException(typeof(MySqlException))]
- public void TestConnectingSocketBadDbName()
- {
- string connStr = "server={0};user id={1};password={2};database=dummy; " +
- "pooling=false";
- MySqlConnection c = new MySqlConnection(
- String.Format(connStr, host, this.user, this.password));
- c.Open();
- c.Close();
- }
+ [Test]
+ public void TestConnectingSocketBadDbName()
+ {
+ string connStr = "server={0};user id={1};password={2};database=dummy; " +
+ "pooling=false";
+ MySqlConnection c = new MySqlConnection(
+ String.Format(connStr, host, this.user, this.password));
+ try
+ {
+ c.Open();
+ c.Close();
+ throw new Exception("Open should not have worked");
+ }
+ catch (MySqlException)
+ {
+ }
+ }
- [Test]
- public void TestPersistSecurityInfoCachingPasswords()
- {
+ [Test]
+ public void TestPersistSecurityInfoCachingPasswords()
+ {
string connStr = GetConnectionString(true);
- MySqlConnection c = new MySqlConnection(connStr);
- c.Open();
- c.Close();
+ MySqlConnection c = new MySqlConnection(connStr);
+ c.Open();
+ c.Close();
- // this shouldn't work
+ // this shouldn't work
connStr = GetConnectionStringEx(user, "bad_password", true);
- c = new MySqlConnection(connStr);
- try
- {
- c.Open();
- Assert.Fail("Thn is should not work");
- c.Close();
- return;
- }
- catch (MySqlException)
- {
- }
+ c = new MySqlConnection(connStr);
+ try
+ {
+ c.Open();
+ Assert.Fail("Thn is should not work");
+ c.Close();
+ return;
+ }
+ catch (MySqlException)
+ {
+ }
- // this should work
+ // this should work
connStr = GetConnectionString(true);
- c = new MySqlConnection(connStr);
- c.Open();
- c.Close();
- }
+ c = new MySqlConnection(connStr);
+ c.Open();
+ c.Close();
+ }
- [Test]
- public void ChangeDatabase()
- {
+ [Test]
+ public void ChangeDatabase()
+ {
string connStr = GetConnectionString(true);
- MySqlConnection c = new MySqlConnection(connStr + ";pooling=false");
- c.Open();
- Assert.IsTrue(c.State == ConnectionState.Open);
+ MySqlConnection c = new MySqlConnection(connStr + ";pooling=false");
+ c.Open();
+ Assert.IsTrue(c.State == ConnectionState.Open);
- Assert.AreEqual(databases[0], c.Database.ToLower());
+ Assert.AreEqual(databases[0], c.Database.ToLower());
- c.ChangeDatabase(databases[1]);
+ c.ChangeDatabase(databases[1]);
- Assert.AreEqual(databases[1], c.Database.ToLower());
+ Assert.AreEqual(databases[1], c.Database.ToLower());
- c.Close();
- }
+ c.Close();
+ }
- [Test]
- public void ConnectionTimeout()
- {
- MySqlConnection c = new MySqlConnection(
- "server=1.1.1.1;user id=bogus;pwd=bogus;Connection timeout=5;" +
+ [Test]
+ public void ConnectionTimeout()
+ {
+ MySqlConnection c = new MySqlConnection(
+ "server=1.1.1.1;user id=bogus;pwd=bogus;Connection timeout=5;" +
"pooling=false");
- DateTime start = DateTime.Now;
- try
- {
- c.Open();
- }
- catch (Exception)
- {
- TimeSpan diff = DateTime.Now.Subtract(start);
- Assert.IsTrue(diff.TotalSeconds < 15, "Timeout exceeded");
- }
- }
+ DateTime start = DateTime.Now;
+ try
+ {
+ c.Open();
+ }
+ catch (Exception)
+ {
+ TimeSpan diff = DateTime.Now.Subtract(start);
+ Assert.IsTrue(diff.TotalSeconds < 15, "Timeout exceeded");
+ }
+ }
- [Category("NotWorking")]
+ /* [Test]
+ public void AnonymousLogin()
+ {
+ suExecSQL(String.Format("GRANT ALL ON *.* to ''@'{0}' IDENTIFIED BY 'set_to_blank'", host));
+ suExecSQL("UPDATE mysql.user SET password='' WHERE password='set_to_blank'");
+
+ MySqlConnection c = new MySqlConnection(String.Empty);
+ c.Open();
+ c.Close();
+ }
+ */
[Test]
- public void AnonymousLogin()
+ public void ConnectInVariousWays()
{
- suExecSQL(String.Format("GRANT ALL ON *.* to ''@'{0}' IDENTIFIED BY 'set_to_blank'", host));
- suExecSQL("UPDATE mysql.user SET password='' WHERE password='set_to_blank'");
+ try
+ {
+ string connStr = conn.ConnectionString;
- MySqlConnection c = new MySqlConnection(String.Empty);
- c.Open();
- c.Close();
- }
+ // connect with no db
+ string connStr2 = GetConnectionString(false);
+ MySqlConnection c = new MySqlConnection(connStr2);
+ c.Open();
+ c.Close();
- [Test]
- public void ConnectInVariousWays()
- {
- try
- {
- string connStr = conn.ConnectionString;
-
- // connect with no db
- string connStr2 = GetConnectionString(false);
- MySqlConnection c = new MySqlConnection(connStr2);
- c.Open();
- c.Close();
-
- suExecSQL("GRANT ALL ON *.* to 'nopass'@'%'");
+ suExecSQL("GRANT ALL ON *.* to 'nopass'@'%'");
suExecSQL("GRANT ALL ON *.* to 'nopass'@'localhost'");
suExecSQL("FLUSH PRIVILEGES");
- // connect with no password
+ // connect with no password
connStr2 = GetConnectionStringEx("nopass", null, false);
- c = new MySqlConnection(connStr2);
- c.Open();
- c.Close();
+ c = new MySqlConnection(connStr2);
+ c.Open();
+ c.Close();
- connStr2 = GetConnectionStringEx("nopass", "", false);
- c = new MySqlConnection(connStr2);
- c.Open();
- c.Close();
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- suExecSQL("DELETE FROM mysql.user WHERE length(user) = 0");
- suExecSQL("DELETE FROM mysql.user WHERE user='nopass'");
- suExecSQL("FLUSH PRIVILEGES");
- }
- }
+ connStr2 = GetConnectionStringEx("nopass", "", false);
+ c = new MySqlConnection(connStr2);
+ c.Open();
+ c.Close();
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail(ex.Message);
+ }
+ finally
+ {
+ suExecSQL("DELETE FROM mysql.user WHERE length(user) = 0");
+ suExecSQL("DELETE FROM mysql.user WHERE user='nopass'");
+ suExecSQL("FLUSH PRIVILEGES");
+ }
+ }
- [Test]
- [Category("4.1")]
- public void ConnectingAsUTF8()
- {
+ [Test]
+ public void ConnectingAsUTF8()
+ {
+ if (Version < new Version(4,1)) return;
+
string connStr = GetConnectionString(true) + ";charset=utf8";
- MySqlConnection c = new MySqlConnection(connStr);
- c.Open();
+ MySqlConnection c = new MySqlConnection(connStr);
+ c.Open();
- MySqlCommand cmd = new MySqlCommand("DROP TABLE IF EXISTS test", c);
- cmd.ExecuteNonQuery();
+ MySqlCommand cmd = new MySqlCommand("DROP TABLE IF EXISTS test", c);
+ cmd.ExecuteNonQuery();
cmd.CommandText = "CREATE TABLE test (id varbinary(16), active bit) CHARACTER SET utf8";
cmd.ExecuteNonQuery();
- cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x1234567890 AS Binary), true)";
- cmd.ExecuteNonQuery();
- cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x123456789a AS Binary), true)";
- cmd.ExecuteNonQuery();
- cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x123456789b AS Binary), true)";
- cmd.ExecuteNonQuery();
- c.Close();
+ cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x1234567890 AS Binary), true)";
+ cmd.ExecuteNonQuery();
+ cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x123456789a AS Binary), true)";
+ cmd.ExecuteNonQuery();
+ cmd.CommandText = "INSERT INTO test (id, active) VALUES (CAST(0x123456789b AS Binary), true)";
+ cmd.ExecuteNonQuery();
+ c.Close();
- MySqlConnection d = new MySqlConnection(connStr);
- d.Open();
+ MySqlConnection d = new MySqlConnection(connStr);
+ d.Open();
- MySqlCommand cmd2 = new MySqlCommand("SELECT id, active FROM test", d);
- MySqlDataReader reader = null;
- try
- {
- reader = cmd2.ExecuteReader();
- Assert.IsTrue(reader.Read());
- Assert.IsTrue(reader.GetBoolean(1));
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (reader != null) reader.Close();
- }
-
- d.Close();
- }
+ MySqlCommand cmd2 = new MySqlCommand("SELECT id, active FROM test", d);
+ MySqlDataReader reader = null;
+ try
+ {
+ reader = cmd2.ExecuteReader();
+ Assert.IsTrue(reader.Read());
+ Assert.IsTrue(reader.GetBoolean(1));
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail(ex.Message);
+ }
+ finally
+ {
+ if (reader != null) reader.Close();
+ }
- /// <summary>
- /// Bug #10281 Clone issue with MySqlConnection
+ d.Close();
+ }
+
+ /// <summary>
+ /// Bug #10281 Clone issue with MySqlConnection
/// Bug #27269 MySqlConnection.Clone does not mimic SqlConnection.Clone behaviour
- /// </summary>
- [Test]
- public void TestConnectionClone()
- {
+ /// </summary>
+ [Test]
+ public void TestConnectionClone()
+ {
MySqlConnection c = new MySqlConnection();
MySqlConnection clone = (MySqlConnection)((ICloneable)c).Clone();
clone.ToString();
@@ -282,19 +294,19 @@
MySqlConnection c2 = (MySqlConnection)((ICloneable)c).Clone();
c2.Open();
c2.Close();
- }
+ }
- /// <summary>
- /// Bug #13321 Persist security info does not woek
- /// </summary>
- [Test]
- public void PersistSecurityInfo()
- {
- string s = GetConnectionString(true).ToLower();
- int start = s.IndexOf("persist security info");
- int end = s.IndexOf(";", start);
- string connStr = s.Substring(0, start);
- connStr += s.Substring(end, s.Length - (end));
+ /// <summary>
+ /// Bug #13321 Persist security info does not woek
+ /// </summary>
+ [Test]
+ public void PersistSecurityInfo()
+ {
+ string s = GetConnectionString(true).ToLower();
+ int start = s.IndexOf("persist security info");
+ int end = s.IndexOf(";", start);
+ string connStr = s.Substring(0, start);
+ connStr += s.Substring(end, s.Length - (end));
string p = "password";
if (connStr.IndexOf("pwd") != -1)
@@ -302,12 +314,12 @@
else if (connStr.IndexOf("passwd") != -1)
p = "passwd";
- string newConnStr = connStr + ";persist security info=true";
- MySqlConnection conn2 = new MySqlConnection(newConnStr);
- Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
- conn2.Open();
- conn2.Close();
- Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
+ string newConnStr = connStr + ";persist security info=true";
+ MySqlConnection conn2 = new MySqlConnection(newConnStr);
+ Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
+ conn2.Open();
+ conn2.Close();
+ Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
newConnStr = connStr + ";persist security info=false";
conn2 = new MySqlConnection(newConnStr);
@@ -315,43 +327,43 @@
conn2.Open();
conn2.Close();
Assert.IsTrue(conn2.ConnectionString.IndexOf(p) == -1);
- }
+ }
- /// <summary>
- /// Bug #13658 connection.state does not update on Ping()
- /// </summary>
- [Test]
- public void PingUpdatesState()
- {
- MySqlConnection conn2 = new MySqlConnection(GetConnectionString(true));
- conn2.Open();
- KillConnection(conn2);
- Assert.IsFalse(conn2.Ping());
- Assert.IsTrue(conn2.State == ConnectionState.Closed);
- }
+ /// <summary>
+ /// Bug #13658 connection.state does not update on Ping()
+ /// </summary>
+ [Test]
+ public void PingUpdatesState()
+ {
+ MySqlConnection conn2 = new MySqlConnection(GetConnectionString(true));
+ conn2.Open();
+ KillConnection(conn2);
+ Assert.IsFalse(conn2.Ping());
+ Assert.IsTrue(conn2.State == ConnectionState.Closed);
+ }
- /// <summary>
- /// Bug #16659 Can't use double quotation marks(") as password access server by Connector/NET
- /// </summary>
- [Test]
- public void ConnectWithQuotePassword()
- {
- suExecSQL("GRANT ALL ON *.* to 'quotedUser'@'%' IDENTIFIED BY '\"'");
+ /// <summary>
+ /// Bug #16659 Can't use double quotation marks(") as password access server by Connector/NET
+ /// </summary>
+ [Test]
+ public void ConnectWithQuotePassword()
+ {
+ suExecSQL("GRANT ALL ON *.* to 'quotedUser'@'%' IDENTIFIED BY '\"'");
suExecSQL("GRANT ALL ON *.* to 'quotedUser'@'localhost' IDENTIFIED BY '\"'");
string connStr = GetConnectionStringEx("quotedUser", null, false);
connStr += ";pwd='\"'";
- MySqlConnection c = new MySqlConnection(connStr);
- try
- {
- c.Open();
- c.Close();
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- suExecSQL("DELETE FROM mysql.user WHERE user='quotedUser'");
- }
+ MySqlConnection c = new MySqlConnection(connStr);
+ try
+ {
+ c.Open();
+ c.Close();
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail(ex.Message);
+ }
+ suExecSQL("DELETE FROM mysql.user WHERE user='quotedUser'");
+ }
/// <summary>
/// Bug #24802 Error Handling
Modified: trunk/TestSuite/Source/CultureTests.cs
===================================================================
--- trunk/TestSuite/Source/CultureTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/CultureTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -45,18 +45,19 @@
Close();
}
-
+#if !CF
[Test]
public void TestFloats()
{
InternalTestFloats(false);
}
- [Category("4.1")]
[Test]
public void TestFloatsPrepared()
{
- InternalTestFloats(true);
+ if (version < new Version(4, 1)) return;
+
+ InternalTestFloats(true);
}
private void InternalTestFloats(bool prepared)
@@ -130,5 +131,6 @@
Thread.CurrentThread.CurrentCulture = curCulture;
Thread.CurrentThread.CurrentUICulture = curUICulture;
}
- }
+#endif
+ }
}
Modified: trunk/TestSuite/Source/DataAdapterTests.cs
===================================================================
--- trunk/TestSuite/Source/DataAdapterTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/DataAdapterTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -122,7 +122,7 @@
Assert.AreEqual(1, count, "checking update count");
DateTime dateTime = (DateTime)dt.Rows[0]["dt"];
- Assert.AreEqual(day1, dateTime, "checking date");
+ Assert.AreEqual(day1.Date, dateTime.Date, "checking date");
Assert.AreEqual(day1.TimeOfDay, dt.Rows[0]["tm"], "checking time");
dt.Rows[0].Delete();
@@ -388,9 +388,11 @@
/// Bug #8292 GROUP BY / WITH ROLLUP with DataSet causes System.Data.ConstraintException
/// </summary>
[Test]
- [Category("4.1")]
public void Rollup()
{
+ if (Version < new Version(4, 1))
+ return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test ( id INT NOT NULL, amount INT )");
execSQL("INSERT INTO test VALUES (1, 44)");
@@ -409,8 +411,7 @@
/// <summary>
/// Bug #8514 CURRENT_TIMESTAMP default not respected
/// </summary>
- [Test]
- [Category("NotWorking")]
+/* [Test]
public void DefaultValues()
{
execSQL("DROP TABLE IF EXISTS test");
@@ -470,7 +471,7 @@
Assert.Fail(ex.Message);
}
}
-
+*/
/// <summary>
/// Bug #16307 @@Identity returning incorrect value
/// </summary>
Modified: trunk/TestSuite/Source/DataReaderTests.cs
===================================================================
--- trunk/TestSuite/Source/DataReaderTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/DataReaderTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -508,19 +508,21 @@
}
[Test]
- [ExpectedException( typeof(MySqlException) )]
public void ReadingFieldsBeforeRead()
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM Test", conn);
MySqlDataReader reader = cmd.ExecuteReader();
- try
- {
- reader.GetInt32(0);
- }
- catch (Exception)
- {
- throw;
- }
+ try
+ {
+ reader.GetInt32(0);
+ }
+ catch (MySqlException)
+ {
+ }
+ catch (Exception)
+ {
+ throw;
+ }
finally
{
if (reader != null) reader.Close();
@@ -845,10 +847,11 @@
/// <summary>
/// Bug #23538 Exception thrown when GetSchemaTable is called and "fields" is null.
/// </summary>
- [Category("5.0")]
[Test]
public void GetSchemaTableOnEmptyResultset()
{
+ if (Version < new Version(5, 0)) return;
+
execSQL("CREATE PROCEDURE spTest() BEGIN END");
MySqlCommand cmd = new MySqlCommand("spTest", conn);
Modified: trunk/TestSuite/Source/DataTypeTests.cs
===================================================================
--- trunk/TestSuite/Source/DataTypeTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/DataTypeTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -59,11 +59,12 @@
InternalBytesAndBooleans(false);
}
- [Category("4.1")]
[Test]
public void BytesAndBooleansPrepared()
{
- InternalBytesAndBooleans(true);
+ if (version < new Version(4, 1)) return;
+
+ InternalBytesAndBooleans(true);
}
private void InternalBytesAndBooleans(bool prepare)
@@ -110,9 +111,10 @@
}
[Test]
- [Category("4.1")]
public void TestFloatPrepared()
{
+ if (version < new Version(4, 1)) return;
+
InternalTestFloats(true);
}
@@ -491,7 +493,7 @@
Assert.AreEqual(1, reader.GetInt32(0));
Assert.AreEqual(2, reader.GetInt32(1));
Assert.AreEqual(120, reader.GetInt32(2));
- if (Is50)
+ if (version >= new Version(5,0))
{
Assert.AreEqual(240, reader.GetInt32(3));
Assert.AreEqual(1000, reader.GetInt32(4));
@@ -625,10 +627,11 @@
}
[Test]
- [Category("5.0")]
public void Bit()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (bit1 BIT, bit2 BIT(5), bit3 BIT(10))");
MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES (?b1, ?b2, ?b3)", conn);
Modified: trunk/TestSuite/Source/DateTimeTests.cs
===================================================================
--- trunk/TestSuite/Source/DateTimeTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/DateTimeTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -45,6 +45,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -263,7 +264,7 @@
}
}
-
+#if !CF
[Test]
public void SortingMySqlDateTimes()
{
@@ -296,6 +297,7 @@
Thread.CurrentThread.CurrentUICulture = curUICulture;
}
}
+#endif
[Test]
public void TestZeroDateTimeException()
@@ -402,8 +404,9 @@
DateTime date = DateTime.Parse("7/24/2005");
StringBuilder sql = new StringBuilder();
- sql.AppendFormat("SELECT ID, ANTENNAID, TEL_TIMESTAMP, LOS_TIMESTAMP FROM test " +
- "WHERE TEL_TIMESTAMP >= '{0}'", date.ToString("u"));
+ sql.AppendFormat(CultureInfo.InvariantCulture,
+ @"SELECT ID, ANTENNAID, TEL_TIMESTAMP, LOS_TIMESTAMP FROM test
+ WHERE TEL_TIMESTAMP >= '{0}'", date.ToString("u"));
MySqlDataAdapter da = new MySqlDataAdapter(sql.ToString(), conn);
DataSet dataSet = new DataSet();
da.Fill(dataSet);
@@ -412,10 +415,11 @@
/// <summary>
/// Bug #17736 Selecting a row with with empty date '0000-00-00' results in Read() hanging.
/// </summary>
- [Category("4.1")]
[Test]
public void PreparedZeroDateTime()
{
+ if (Version < new Version(4, 1)) return;
+
execSQL("INSERT INTO test VALUES(1, Now(), '0000-00-00', NULL, NULL)");
MySqlCommand cmd = new MySqlCommand("SELECT d FROM test WHERE id=?id", conn);
cmd.Parameters.AddWithValue("?id", 1);
Modified: trunk/TestSuite/Source/EventTests.cs
===================================================================
--- trunk/TestSuite/Source/EventTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/EventTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -46,9 +46,10 @@
}
[Test]
- [Category("4.1")]
public void Warnings()
{
+ if (version < new Version(4, 1)) return;
+
conn.InfoMessage += new MySqlInfoMessageEventHandler(WarningsInfoMessage);
execSQL("DROP TABLE IF EXISTS test");
Modified: trunk/TestSuite/Source/GetSchemaTests.cs
===================================================================
--- trunk/TestSuite/Source/GetSchemaTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/GetSchemaTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -58,7 +58,7 @@
Assert.AreEqual("IndexColumns", dt.Rows[10][0]);
Assert.AreEqual("Indexes", dt.Rows[11][0]);
- if (Is50)
+ if (version >= new Version(5,0))
{
Assert.AreEqual("Views", dt.Rows[12][0]);
Assert.AreEqual("ViewColumns", dt.Rows[13][0]);
@@ -163,11 +163,8 @@
string dbName = row[1].ToString().ToLower();
if (dbName == databases[0])
foundZero = true;
- else if (dbName == databases[1])
- foundOne = true;
}
Assert.IsTrue(foundZero);
- Assert.IsTrue(foundOne);
dt = conn.GetSchema("Databases", new string[1] { databases[0] });
Assert.AreEqual(1, dt.Rows.Count);
@@ -236,10 +233,11 @@
Assert.AreEqual("TINYINT", dt.Rows[3]["DATA_TYPE"].ToString().ToUpper());
}
- [Category("5.0")]
[Test]
public void Procedures()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest (id int) BEGIN SELECT 1; END");
@@ -252,10 +250,11 @@
Assert.AreEqual("spTest", dt.Rows[0][3]);
}
- [Category("5.0")]
[Test]
public void Functions()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP FUNCTION IF EXISTS spFunc");
execSQL("CREATE FUNCTION spFunc (id int) RETURNS INT BEGIN RETURN 1; END");
@@ -268,10 +267,11 @@
Assert.AreEqual("spFunc", dt.Rows[0][3]);
}
- [Category("5.0")]
[Test]
public void Indexes()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id int, PRIMARY KEY(id))");
string[] restrictions = new string[4];
@@ -332,10 +332,11 @@
Assert.AreEqual(2, dt.Rows[0]["ORDINAL_POSITION"]);
}
- [Category("5.0")]
[Test]
public void Views()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP VIEW IF EXISTS vw");
execSQL("CREATE VIEW vw AS SELECT Now() as theTime");
@@ -348,10 +349,11 @@
Assert.AreEqual("vw", dt.Rows[0]["TABLE_NAME"]);
}
- [Category("5.0")]
[Test]
public void ViewColumns()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP VIEW IF EXISTS vw");
execSQL("CREATE VIEW vw AS SELECT Now() as theTime");
@@ -367,9 +369,10 @@
}
[Test]
- [Category("5.0")]
public void SingleProcedureParameters()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest(id int, IN id2 INT(11), " +
"INOUT io1 VARCHAR(20), OUT out1 FLOAT) BEGIN END");
@@ -547,10 +550,11 @@
Assert.AreEqual("id", row["REFERENCED_COLUMN_NAME"]);
}
- [Category("5.0")]
[Test]
public void Triggers()
{
+ if (version < new Version(5, 0)) return;
+
try
{
suExecSQL("DROP TRIGGER trigger1");
Modified: trunk/TestSuite/Source/InterfaceTests.cs
===================================================================
--- trunk/TestSuite/Source/InterfaceTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/InterfaceTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -41,7 +41,7 @@
Close();
}
-#if !NET_CF
+#if !CF
[Test]
public void ClientFactory()
{
Modified: trunk/TestSuite/Source/LanguageTests.cs
===================================================================
--- trunk/TestSuite/Source/LanguageTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/LanguageTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -43,9 +43,10 @@
}
[Test]
- [Category("4.1")]
public void Unicode()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (u2 varchar(255) CHARACTER SET ucs2)");
@@ -103,9 +104,10 @@
}
[Test]
- [Category("4.1")]
public void UTF8()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (id int, name VARCHAR(200) CHAR SET utf8)");
@@ -170,9 +172,10 @@
}
[Test]
- [Category("4.1")]
public void UTF8PreparedAndUsingParameters()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (name VARCHAR(200) CHAR SET utf8)");
@@ -241,9 +244,10 @@
}
[Test]
- [Category("4.1")]
public void Chinese()
{
+ if (version < new Version(4, 1)) return;
+
MySqlConnection c = new MySqlConnection(conn.ConnectionString + ";charset=utf8");
c.Open();
@@ -274,9 +278,10 @@
}
[Test]
- [Category("4.1")]
public void Turkish()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (id int, name VARCHAR(200) CHAR SET latin5 )");
@@ -307,9 +312,10 @@
}
[Test]
- [Category("4.1")]
public void Russian()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (id int, name VARCHAR(200) CHAR SET cp1251)");
@@ -339,9 +345,10 @@
}
[Test]
- [Category("4.1")]
public void VariousCollations()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("CREATE TABLE `test_tbl` ( `test` VARCHAR( 255 ) NOT NULL) CHARACTER SET utf8 COLLATE utf8_swedish_ci TYPE = MYISAM");
execSQL("INSERT INTO test_tbl VALUES ('myval')");
try
Modified: trunk/TestSuite/Source/MicroPerfTests.cs
===================================================================
--- trunk/TestSuite/Source/MicroPerfTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/MicroPerfTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -41,23 +41,5 @@
{
Close();
}
-
- [Explicit]
- [Test]
- public void Connect1000Times()
- {
- DateTime start = DateTime.Now;
-
- for (int i = 0; i < 1000; i++)
- {
- MySqlConnection c = new MySqlConnection(
- base.GetConnectionString(true));
- c.Open();
- c.Close();
- }
-
- TimeSpan ts = DateTime.Now.Subtract(start);
- double secs = ts.TotalSeconds;
- }
}
}
Modified: trunk/TestSuite/Source/MySqlHelperTests.cs
===================================================================
--- trunk/TestSuite/Source/MySqlHelperTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/MySqlHelperTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -50,11 +50,12 @@
/// Bug #11490 certain incorrect queries trigger connection must be valid and open message
/// </summary>
[Test]
- [Category("4.1")]
public void Bug11490()
{
- MySqlDataReader reader = null;
+ if (version < new Version(4, 1)) return;
+ MySqlDataReader reader = null;
+
try
{
StringBuilder sb = new StringBuilder();
Modified: trunk/TestSuite/Source/ParameterTests.cs
===================================================================
--- trunk/TestSuite/Source/ParameterTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/ParameterTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -43,6 +43,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -245,11 +246,16 @@
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void NullParameterObject()
{
MySqlCommand cmd = new MySqlCommand("INSERT INTO Test (id, name) VALUES (1, ?name)", conn);
- cmd.Parameters.Add( null );
+ try
+ {
+ cmd.Parameters.Add(null);
+ }
+ catch (ArgumentException)
+ {
+ }
}
/// <summary>
Modified: trunk/TestSuite/Source/PoolingTests.cs
===================================================================
--- trunk/TestSuite/Source/PoolingTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/PoolingTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -224,6 +224,8 @@
+
+
@@ -257,6 +259,9 @@
+
+
+
\ No newline at end of file
Modified: trunk/TestSuite/Source/PreparedStatements.cs
===================================================================
--- trunk/TestSuite/Source/PreparedStatements.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/PreparedStatements.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -334,11 +334,12 @@
}
[Test]
- [Category("4.1")]
public void Bug6271()
{
- execSQL("DROP TABLE IF EXISTS Test2");
+ if (version < new Version(4, 1)) return;
+ execSQL("DROP TABLE IF EXISTS Test2");
+
// Create the table again
execSQL("CREATE TABLE `Test2` (id INT unsigned NOT NULL auto_increment, " +
"`xpDOSG_Name` text,`xpDOSG_Desc` text, `Avatar` MEDIUMBLOB, `dtAdded` DATETIME, `dtTime` TIMESTAMP, " +
@@ -434,10 +435,11 @@
/// Bug #13662 Prepare() truncates accented character input
/// </summary>
[Test]
- [Category("4.1")]
public void InsertAccentedCharacters()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(4, 1)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id INT UNSIGNED NOT NULL PRIMARY KEY " +
"AUTO_INCREMENT, input TEXT NOT NULL) CHARACTER SET UTF8");
// COLLATE " +
@@ -474,10 +476,11 @@
/// Bug #13541 Prepare breaks if a parameter is used more than once
/// </summary>
[Test]
- [Category("4.1")]
public void UsingParametersTwice()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(4, 1)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE IF NOT EXISTS test (input TEXT NOT NULL, " +
"UNIQUE (input(100)), state INT NOT NULL, score INT NOT NULL)");
@@ -508,9 +511,10 @@
/// Bug #19261 Supplying Input Parameters
/// </summary>
[Test]
- [Category("4.1")]
public void MoreParametersOutOfOrder()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE `test` (`BlackListID` int(11) NOT NULL auto_increment, " +
"`SubscriberID` int(11) NOT NULL, `Phone` varchar(50) default NULL, " +
@@ -556,9 +560,10 @@
/// Bug #16627 Index and length must refer to a location within the string." when executing c
/// </summary>
[Test]
- [Category("4.1")]
public void ParameterLengths()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE test");
execSQL("CREATE TABLE test (id int, name VARCHAR(255))");
@@ -584,9 +589,10 @@
/// Bug #18570 Unsigned tinyint (NET byte) incorrectly determined param type from param val
/// </summary>
[Test]
- [Category("4.1")]
public void UnsignedTinyInt()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test(ID TINYINT UNSIGNED NOT NULL, " +
"Name VARCHAR(50) NOT NULL, PRIMARY KEY (ID), UNIQUE (ID), " +
@@ -627,9 +633,10 @@
/// Bug #16934 Unsigned values > 2^63 (UInt64) cannot be used in prepared statements
/// </summary>
[Test]
- [Category("4.1")]
public void UnsignedValues()
{
+ if (version < new Version(4, 1)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (ulVal BIGINT UNSIGNED, lVal INT UNSIGNED, " +
"mVal MEDIUMINT UNSIGNED, sVal SMALLINT UNSIGNED)");
@@ -733,7 +740,7 @@
}
#region Configs
-
+#if !CF
[Category("Compressed")]
public class PreparedStatementsSocketCompressed : PreparedStatements
{
@@ -780,7 +787,7 @@
return String.Format("protocol=memory; shared memory name={0};compress=true", memoryName);
}
}
-
+#endif
#endregion
}
Modified: trunk/TestSuite/Source/ProcedureParameters.cs
===================================================================
--- trunk/TestSuite/Source/ProcedureParameters.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/ProcedureParameters.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -40,10 +40,11 @@
Close();
}
- [Category("5.0")]
[Test]
public void ProcedureParameters()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest (id int, name varchar(50)) BEGIN SELECT 1; END");
Modified: trunk/TestSuite/Source/SimpleTransactions.cs
===================================================================
--- trunk/TestSuite/Source/SimpleTransactions.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/SimpleTransactions.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -23,7 +23,6 @@
using System.IO;
using NUnit.Framework;
#if NET20
-using System.Transactions;
using System.Data.Common;
#endif
Modified: trunk/TestSuite/Source/StoredProcedure.cs
===================================================================
--- trunk/TestSuite/Source/StoredProcedure.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/StoredProcedure.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -32,7 +32,6 @@
/// <summary>
/// Summary description for StoredProcedure.
/// </summary>
- [Category("5.0")]
[TestFixture]
public class StoredProcedure : BaseTest
{
@@ -51,6 +50,7 @@
Close();
}
+ [SetUp]
protected override void Setup()
{
base.Setup();
@@ -64,7 +64,9 @@
[Test]
public void ReturningResultset()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest(val decimal(10,3)) begin select val; end");
using (MySqlCommand cmd = new MySqlCommand("spTest", conn))
@@ -84,8 +86,10 @@
[Test]
public void NonQuery()
{
- execSQL("CREATE PROCEDURE spTest(IN value INT) BEGIN INSERT INTO Test VALUES(value, 'Test'); END");
+ if (version < new Version(5, 0)) return;
+ execSQL("CREATE PROCEDURE spTest(IN value INT) BEGIN INSERT INTO Test VALUES(value, 'Test'); END");
+
//setup testing data
MySqlCommand cmd = new MySqlCommand("spTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
@@ -123,7 +127,9 @@
[Test]
public void OutputParameters()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("DROP PROCEDURE IF EXISTS spCount");
execSQL("CREATE PROCEDURE spCount(out value VARCHAR(350), OUT intVal INT, " +
"OUT dateVal TIMESTAMP, OUT floatVal FLOAT, OUT noTypeVarChar VARCHAR(20), " +
@@ -166,7 +172,9 @@
[Test]
public void NoBatch()
{
- try
+ if (version < new Version(5, 0)) return;
+
+ try
{
MySqlCommand cmd = new MySqlCommand("spTest;select * from test", conn);
cmd.CommandType = CommandType.StoredProcedure;
@@ -181,7 +189,9 @@
[Test]
public void WrongParameters()
{
- execSQL("CREATE PROCEDURE spTest(p1 INT) BEGIN SELECT 1; END");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE PROCEDURE spTest(p1 INT) BEGIN SELECT 1; END");
try
{
MySqlCommand cmd = new MySqlCommand("spTest", conn);
@@ -198,7 +208,9 @@
[Test]
public void NoInOutMarker()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest( valin varchar(50) ) BEGIN SELECT valin; END");
MySqlCommand cmd = new MySqlCommand("spTest", conn);
@@ -211,7 +223,9 @@
[Test]
public void InputOutputParameters()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest( INOUT strVal VARCHAR(50), INOUT numVal INT, OUT outVal INT UNSIGNED ) " +
"BEGIN SET strVal = CONCAT(strVal,'ending'); SET numVal=numVal * 2; SET outVal=99; END");
@@ -233,7 +247,9 @@
[Test]
public void NoSPOnPre50()
{
- try
+ if (version < new Version(5, 0)) return;
+
+ try
{
MySqlCommand cmd = new MySqlCommand("spTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
@@ -248,7 +264,9 @@
[Test]
public void ExecuteScalar()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest( IN valin VARCHAR(50), OUT valout VARCHAR(50) ) " +
"BEGIN SET valout=valin; SELECT 'Test'; END");
@@ -268,7 +286,9 @@
[Test]
public void ExecuteScalar2()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest() " +
"BEGIN DECLARE myVar1 INT; SET myVar1 := 1; SELECT myVar1; END");
@@ -282,7 +302,9 @@
[Test]
public void ExecuteReader()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest(OUT p INT) " +
"BEGIN SELECT 1; SET p=2; END");
@@ -302,18 +324,24 @@
[Test]
public void MultipleResultsets()
{
- MultipleResultsetsImpl(false);
+ if (version < new Version(5, 0)) return;
+
+ MultipleResultsetsImpl(false);
}
[Test]
public void MultipleResultsetsPrepared()
{
- MultipleResultsetsImpl(true);
+ if (version < new Version(5, 0)) return;
+
+ MultipleResultsetsImpl(true);
}
private void MultipleResultsetsImpl(bool prepare)
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest() " +
"BEGIN SELECT 1; SELECT 2; END");
@@ -345,14 +373,18 @@
private void da_FillError(object sender, FillErrorEventArgs e)
{
- fillError = e.Errors.Message;
+ if (version < new Version(5, 0)) return;
+
+ fillError = e.Errors.Message;
e.Continue = true;
}
[Test]
public void FunctionNoParams()
{
- execSQL("CREATE FUNCTION fnTest() RETURNS CHAR(50)" +
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE FUNCTION fnTest() RETURNS CHAR(50)" +
" LANGUAGE SQL DETERMINISTIC BEGIN RETURN \"Test\"; END");
MySqlCommand cmd = new MySqlCommand("SELECT fnTest()", conn);
@@ -364,7 +396,9 @@
[Test]
public void FunctionParams()
{
- execSQL("CREATE FUNCTION fnTest( val1 INT, val2 CHAR(40) ) RETURNS INT " +
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE FUNCTION fnTest( val1 INT, val2 CHAR(40) ) RETURNS INT " +
" LANGUAGE SQL DETERMINISTIC BEGIN RETURN val1 + LENGTH(val2); END");
MySqlCommand cmd = new MySqlCommand("SELECT fnTest(22, 'Test')", conn);
@@ -376,7 +410,9 @@
[Test]
public void UseOldSyntax()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest( IN valin VARCHAR(50), OUT valout VARCHAR(50) ) " +
"BEGIN SET valout=valin; SELECT 'Test'; END");
@@ -397,7 +433,9 @@
[Test]
public void ExecuteWithCreate()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
string sql = "CREATE PROCEDURE spTest(IN var INT) BEGIN SELECT var; END; call spTest(?v)";
MySqlCommand cmd = new MySqlCommand(sql, conn);
@@ -412,7 +450,9 @@
[Test]
public void OtherProcSigs()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest(IN \r\nvalin DECIMAL(10,2),\nIN val2 INT) " +
"SQL SECURITY INVOKER BEGIN SELECT valin; END");
@@ -441,7 +481,9 @@
[Test]
public void CallingStoredFunctionasProcedure()
{
- execSQL("CREATE FUNCTION fnTest(valin int) RETURNS INT " +
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE FUNCTION fnTest(valin int) RETURNS INT " +
" LANGUAGE SQL DETERMINISTIC BEGIN return valin * 2; END");
MySqlCommand cmd = new MySqlCommand("fnTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
@@ -461,7 +503,9 @@
[Test]
public void NoDefaultDatabase()
{
- // create our procedure
+ if (version < new Version(5, 0)) return;
+
+ // create our procedure
execSQL("CREATE PROCEDURE spTest() BEGIN SELECT 4; END");
string newConnStr = GetConnectionString(false);
@@ -497,8 +541,7 @@
/// <summary>
/// Bug #13590 ExecuteScalar returns only Int64 regardless of actual SQL type
/// </summary>
- [Category("NotWorking")]
- [Test]
+/* [Test]
public void TestSelectingInts()
{
execSQL("CREATE PROCEDURE spTest() BEGIN DECLARE myVar INT; " +
@@ -510,7 +553,7 @@
Assert.AreEqual(1, val, "Checking value");
Assert.IsTrue(val is System.Int32, "Checking type");
}
-
+*/
/// <summary>
/// Bug #13632 the MySQLCommandBuilder.deriveparameters has not been updated for MySQL 5
/// Bug #15077 Error MySqlCommandBuilder.DeriveParameters for sp without parameters.
@@ -519,7 +562,9 @@
[Test]
public void DeriveParameters()
{
- execSQL("DROP TABLE IF EXISTS test2");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS test2");
execSQL("CREATE TABLE test2 (c CHAR(20))");
execSQL("INSERT INTO test2 values ( 'xxxx')");
MySqlCommand cmd2 = new MySqlCommand("SELECT * FROM test2", conn);
@@ -589,7 +634,9 @@
[Test]
public void DeriveParametersForFunction()
{
- try
+ if (version < new Version(5, 0)) return;
+
+ try
{
execSQL("CREATE FUNCTION fnTest(v1 DATETIME) RETURNS INT " +
" LANGUAGE SQL DETERMINISTIC BEGIN RETURN 1; END");
@@ -619,8 +666,10 @@
[Test]
public void DecimalAsParameter()
{
- execSQL("CREATE PROCEDURE spTest(IN d DECIMAL(19,4)) BEGIN SELECT d; END");
+ if (version < new Version(5, 0)) return;
+ execSQL("CREATE PROCEDURE spTest(IN d DECIMAL(19,4)) BEGIN SELECT d; END");
+
MySqlCommand cmd = new MySqlCommand("spTest", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("?d", 21);
@@ -634,7 +683,9 @@
[Test]
public void ParmWithCharacterSet()
{
- execSQL("CREATE PROCEDURE spTest(P longtext character set utf8) " +
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE PROCEDURE spTest(P longtext character set utf8) " +
"BEGIN SELECT P; END");
MySqlCommand cmd = new MySqlCommand("spTest", conn);
@@ -650,7 +701,9 @@
[Test]
public void SpecialCharacters()
{
- execSQL("SET sql_mode=ANSI_QUOTES");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("SET sql_mode=ANSI_QUOTES");
try
{
execSQL("CREATE PROCEDURE spTest(\"@Param1\" text) BEGIN SELECT \"@Param1\"; END");
@@ -675,7 +728,9 @@
[Test]
public void CallingSPWithPrepare()
{
- execSQL("DROP PROCEDURE IF EXISTS spTest");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest(P int) BEGIN SELECT P; END");
MySqlCommand cmd = new MySqlCommand("spTest", conn);
@@ -693,7 +748,9 @@
[Test]
public void MultipleRecords()
{
- execSQL("DROP PROCEDURE IF EXISTS spTest");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest(id int, str VARCHAR(45)) " +
"BEGIN INSERT INTO test VALUES(id, str); END");
@@ -725,7 +782,9 @@
[Test]
public void Bug16788()
{
- execSQL("DROP TABLE IF EXISTS Test");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (id integer(9), state varchar(2))");
execSQL("CREATE PROCEDURE spTest(IN p1 integer(9), IN p2 varchar(2)) " +
"BEGIN " +
@@ -752,7 +811,9 @@
[Test]
public void ReturningEmptyResultSet()
{
- execSQL("DROP PROCEDURE IF EXISTS spTest");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("DROP TABLE IF EXISTS test1");
execSQL("DROP TABLE IF EXISTS test2");
execSQL("CREATE TABLE test1 (id int AUTO_INCREMENT NOT NULL, " +
@@ -788,6 +849,7 @@
}
}
+#if !CF
[Explicit]
[Test]
public void ProcedureCache()
@@ -835,6 +897,7 @@
execSQL("DROP PROCEDURE IF EXISTS spTest" + x);
}
}
+#endif
/// <summary>
/// Bug #20581 Null Reference Exception when closing reader after stored procedure.
@@ -842,7 +905,9 @@
[Test]
public void Bug20581()
{
- execSQL("CREATE PROCEDURE spTest(p int) BEGIN SELECT p; END");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE PROCEDURE spTest(p int) BEGIN SELECT p; END");
MySqlParameter param1;
MySqlCommand command = new MySqlCommand("spTest", conn);
command.CommandType = System.Data.CommandType.StoredProcedure;
@@ -874,7 +939,9 @@
[Test]
public void PreparedReader()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id int(10) unsigned NOT NULL default '0', " +
"val int(10) unsigned default NULL, PRIMARY KEY (id)) " +
"ENGINE=InnoDB DEFAULT CHARSET=utf8");
@@ -911,7 +978,9 @@
[Test]
public void UnsignedOutputParameters()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test (id INT(10) UNSIGNED AUTO_INCREMENT, PRIMARY KEY (id)) ");
execSQL("CREATE PROCEDURE spTest (OUT id BIGINT UNSIGNED) " +
"BEGIN INSERT INTO test VALUES (NULL); SET id=LAST_INSERT_ID(); END");
@@ -927,13 +996,17 @@
Assert.AreEqual(1, o);
}
+#if !CF
+
/// <summary>
/// Bug #22452 MySql.Data.MySqlClient.MySqlException:
/// </summary>
[Test]
public void TurkishStoredProcs()
{
- execSQL("CREATE PROCEDURE spTest(IN p_paramname INT) BEGIN SELECT p_paramname; END");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("CREATE PROCEDURE spTest(IN p_paramname INT) BEGIN SELECT p_paramname; END");
CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture;
CultureInfo culture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
@@ -957,13 +1030,17 @@
}
}
+#endif
+
/// <summary>
/// Bug #23268 System.FormatException when invoking procedure with ENUM input parameter
/// </summary>
[Test]
public void ProcEnumParamTest()
{
- execSQL("DROP TABLE IF EXISTS test");
+ if (version < new Version(5, 0)) return;
+
+ execSQL("DROP TABLE IF EXISTS test");
execSQL("CREATE TABLE test(str VARCHAR(50), e ENUM ('P','R','F','E'), i INT(6))");
execSQL("CREATE PROCEDURE spTest(IN p_enum ENUM('P','R','F','E')) BEGIN " +
"INSERT INTO test (str, e, i) VALUES (null, p_enum, 55); END");
@@ -994,6 +1071,8 @@
[Test]
public void CheckNameOfReturnParameter()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("CREATE FUNCTION fnTest() RETURNS CHAR(50)" +
" LANGUAGE SQL DETERMINISTIC BEGIN RETURN \"Test\"; END");
@@ -1010,6 +1089,8 @@
[Test]
public void RunWithoutSelectPrivsThrowException()
{
+ if (version < new Version(5, 0)) return;
+
suExecSQL(String.Format(
"GRANT ALL ON {0}.* to 'testuser'@'%' identified by 'testuser'",
databases[0]));
@@ -1059,6 +1140,8 @@
[Test]
public void CallingFunctionWithoutReturnParameter()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("CREATE FUNCTION fnTest (p_kiosk bigint(20), " +
"p_user bigint(20)) returns double begin declare v_return double; " +
"set v_return = 3.6; return v_return; end");
@@ -1084,6 +1167,8 @@
[Test]
public void GetSchema()
{
+ if (version < new Version(5, 0)) return;
+
try
{
execSQL("CREATE PROCEDURE spTest() BEGIN SELECT * FROM test; END");
@@ -1111,8 +1196,7 @@
/// Currently this is borked on the server so we are marking this as notworking
/// until the server has this fixed.
/// </summary>
- [Category("NotWorking")]
- [Test]
+/* [Test]
public void LastInsertId()
{
execSQL("DROP TABLE IF EXISTS test");
@@ -1126,10 +1210,12 @@
cmd.ExecuteNonQuery();
Assert.AreEqual(2, cmd.LastInsertedId);
}
-
+ */
[Test]
public void NoAccessToProcedureBodies()
{
+ if (version < new Version(5, 0)) return;
+
suExecSQL("DROP PROCEDURE IF EXISTS spTest");
suExecSQL("CREATE PROCEDURE spTest(in1 INT, INOUT inout1 INT, OUT out1 INT ) " +
"BEGIN SET inout1 = inout1+2; SET out1=inout1-3; SELECT in1; END");
@@ -1163,6 +1249,8 @@
[Test]
public void BinaryAndVarBinaryParameters()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP PROCEDURE IF EXISTS spTest");
execSQL("CREATE PROCEDURE spTest(OUT out1 BINARY(20), OUT out2 VARBINARY(20)) " +
"BEGIN SET out1 = 'out1'; SET out2='out2'; END");
@@ -1201,6 +1289,8 @@
[Test]
public void UsingUInt64AsParam()
{
+ if (version < new Version(5, 0)) return;
+
execSQL("DROP TABLE IF EXISTS test");
execSQL(@"CREATE TABLE test(f1 bigint(20) unsigned NOT NULL,
PRIMARY KEY(f1)) ENGINE=InnoDB DEFAULT CHARSET=utf8");
Modified: trunk/TestSuite/Source/StressTests.cs
===================================================================
--- trunk/TestSuite/Source/StressTests.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/StressTests.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -48,6 +48,8 @@
Close();
}
+#if !CF
+
[Test]
public void TestMultiPacket()
{
@@ -103,6 +105,8 @@
}
}
+#endif
+
[Test]
public void TestSequence()
{
@@ -145,6 +149,7 @@
#region Configs
+#if !CF
[Category("Compressed")]
public class StressTestsSocketCompressed : StressTests
{
@@ -191,7 +196,7 @@
return String.Format("protocol=memory; shared memory name={0};compress=true", memoryName);
}
}
-
+#endif
#endregion
}
Modified: trunk/TestSuite/Source/Syntax.cs
===================================================================
--- trunk/TestSuite/Source/Syntax.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/Syntax.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -61,10 +61,11 @@
}
[Test]
- [Category("4.1")]
public void ProblemCharsInSQLUTF8()
{
- execSQL("DROP TABLE IF EXISTS Test");
+ if (version < new Version(4, 1)) return;
+
+ execSQL("DROP TABLE IF EXISTS Test");
execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(250), mt MEDIUMTEXT, " +
"PRIMARY KEY(id)) CHAR SET utf8");
@@ -296,11 +297,12 @@
}
}
- [Category("4.1")]
[Test]
public void ForceWarnings()
{
- MySqlCommand cmd = new MySqlCommand("SELECT * FROM test; DROP TABLE IF EXISTS test2; SELECT * FROM test", conn);
+ if (version < new Version(4, 1)) return;
+
+ MySqlCommand cmd = new MySqlCommand("SELECT * FROM test; DROP TABLE IF EXISTS test2; SELECT * FROM test", conn);
MySqlDataReader reader = null;
try
{
Modified: trunk/TestSuite/Source/TimeoutAndCancel.cs
===================================================================
--- trunk/TestSuite/Source/TimeoutAndCancel.cs 2007-04-13 17:40:20 UTC (rev 673)
+++ trunk/TestSuite/Source/TimeoutAndCancel.cs 2007-04-13 17:42:53 UTC (rev 674)
@@ -56,10 +56,11 @@
}
}
- [Category("5.0")]
[Test]
public void CancelSingleQuery()
{
+ if (version < new Version(5, 0)) return;
+
// first we need a routine that will run for a bit
execSQL("CREATE PROCEDURE spTest() BEGIN SET @start=NOW()+0; REPEAT SET @end=NOW()-@start; " +
"UNTIL @end >= 5000 END REPEAT; SELECT @start, @end; END");
@@ -119,11 +120,11 @@
stateChangeCount++;
}
- [Category("NotWorking")]
- [Category("5.0")]
- [Test]
+/* [Test]
public void TimeoutExpiring()
{
+ if (version < new Version(5, 0)) return;
+
// first we need a routine that will run for a bit
execSQL("CREATE PROCEDURE spTest() BEGIN SET @start=UNIX_TIMESTAMP(NOW()); " +
"REPEAT SET @end=UNIX_TIMESTAMP(NOW())-@start; " +
@@ -145,11 +146,13 @@
Assert.IsTrue(ts.TotalSeconds < 60, "Took too much time");
}
}
+ */
- [Category("5.0")]
[Test]
public void TimeoutNotExpiring()
{
+ if (version < new Version(5, 0)) return;
+
// first we need a routine that will run for a bit
execSQL("CREATE PROCEDURE spTest() BEGIN SET @start=NOW()+0; REPEAT SET @end=NOW()-@start; " +
"UNTIL @end >= 5 END REPEAT; SELECT @start, @end; END");
| Thread |
|---|
| • Connector/NET commit: r674 - in trunk: . Driver Driver/Source Driver/Source/Types Driver/Source/base Driver/Source/common TestSuite/Source | rburnett | 13 Apr |