Skip to content

Commit

Permalink
Upgrade integration tests to MySql.Data 8.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Aug 16, 2023
1 parent ca63a91 commit 5ade1ae
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 25 deletions.
19 changes: 10 additions & 9 deletions docs/content/tutorials/migrating-from-connector-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In a .NET Framework application, make the following `app.config` change to regis
<!-- add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.33.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / -->
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.1.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / -->

<!-- ADD THIS -->
<add name="MySqlConnector"
Expand Down Expand Up @@ -314,18 +314,19 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
* ~~[#106244](https://bugs.mysql.com/bug.php?id=106244): `MySqlDataReader.GetFieldValue<Stream>` throws `InvalidCastException`~~
* ~~[#106247](https://bugs.mysql.com/bug.php?id=106247): Can't use ~~`MySqlDbType.Enum` or~~ `MySqlDbType.Set` with prepared command~~
* [#107259](https://bugs.mysql.com/bug.php?id=107259): Character Set 'utf8mb3' is not supported by .NET Framework
* [#108756](https://bugs.mysql.com/bug.php?id=108756): Can't insert negative number using prepared statement with `MySqlDbType.Int24`
* ~~[#108756](https://bugs.mysql.com/bug.php?id=108756): Can't insert negative number using prepared statement with `MySqlDbType.Int24`~~
* [#108970](https://bugs.mysql.com/bug.php?id=108970): `MySqlConnectionStringBuilder.ContainsKey` method gives wrong result
* [#109141](https://bugs.mysql.com/bug.php?id=109141): Insert of data into a table results in `System.ArgumentException`
* [#109331](https://bugs.mysql.com/bug.php?id=109331): MySQL Connector/NET is incompatible with MariaDB 10.10 and later
* [#109390](https://bugs.mysql.com/bug.php?id=109390): Transaction lock held after connection timeout exception
* [#109476](https://bugs.mysql.com/bug.php?id=109476): `TransactionScope.Dispose` throws "Connection must be valid and open to rollback"
* ~[#109670](https://bugs.mysql.com/bug.php?id=109670), [#109752](https://bugs.mysql.com/bug.php?id=109752): Many MSB3246 errors when referencing MySql.Data 8.0.32~
* [#109682](https://bugs.mysql.com/bug.php?id=109682): `MySqlParameter.Clone` loses specific `MySqlDbType`.
* ~~[#109670](https://bugs.mysql.com/bug.php?id=109670), [#109752](https://bugs.mysql.com/bug.php?id=109752): Many MSB3246 errors when referencing MySql.Data 8.0.32~~
* ~~[#109682](https://bugs.mysql.com/bug.php?id=109682): `MySqlParameter.Clone` loses specific `MySqlDbType`.~~
* ~~[#109683](https://bugs.mysql.com/bug.php?id=109683): `MySqlCommand.LastInsertedId` is incorrect if multiple rows are inserted.~~
* ~~[#109716](https://bugs.mysql.com/bug.php?id=109716), [#109727](https://bugs.mysql.com/bug.php?id=109727): Failed to add reference to 'comerr64'~~
* [110717](https://bugs.mysql.com/bug.php?id=110717), [#111759](https://bugs.mysql.com/bug.php?id=111759): MySql.Data is not thread-safe
* [110789](https://bugs.mysql.com/bug.php?id=110789): `OpenAsync` throws unhandled exception from thread pool
* [110790](https://bugs.mysql.com/bug.php?id=110790): `ExecuteReaderAsync` hangs instead of cancelling query after `CommandTimeout`
* [110791](https://bugs.mysql.com/bug.php?id=110791): `OpenAsync(CancellationToken)` doesn't throw for cancelled token
* [110797](https://bugs.mysql.com/bug.php?id=110797): Certain sequence of special characters can break connection string validation.
* [#110717](https://bugs.mysql.com/bug.php?id=110717), [#111759](https://bugs.mysql.com/bug.php?id=111759): MySql.Data is not thread-safe
* [#110789](https://bugs.mysql.com/bug.php?id=110789): `OpenAsync` throws unhandled exception from thread pool
* [#110790](https://bugs.mysql.com/bug.php?id=110790): `ExecuteReaderAsync` hangs instead of cancelling query after `CommandTimeout`
* [#110791](https://bugs.mysql.com/bug.php?id=110791): `OpenAsync(CancellationToken)` doesn't throw for cancelled token
* [#110797](https://bugs.mysql.com/bug.php?id=110797): Certain sequence of special characters can break connection string validation.
* [#112088](https://bugs.mysql.com/bug.php?id=112088): `BIT(n)` parameter size incorrectly returns 0
2 changes: 1 addition & 1 deletion tests/IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'MySqlData' ">
<PackageReference Include="MySql.Data" Version="8.0.33" />
<PackageReference Include="MySql.Data" Version="8.1.0" />
<Using Include="MySql.Data.MySqlClient" />
</ItemGroup>

Expand Down
5 changes: 0 additions & 5 deletions tests/IntegrationTests/PreparedCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,7 @@ public static IEnumerable<object[]> GetInsertAndQueryData()
yield return new object[] { isPrepared, "TINYINT UNSIGNED", (byte) 123, MySqlDbType.UByte };
yield return new object[] { isPrepared, "SMALLINT", (short) -12345, MySqlDbType.Int16 };
yield return new object[] { isPrepared, "SMALLINT UNSIGNED", (ushort) 12345, MySqlDbType.UInt16 };
#if !MYSQL_DATA
yield return new object[] { isPrepared, "MEDIUMINT", -1234567, MySqlDbType.Int24 };
#else
// https://bugs.mysql.com/bug.php?id=108756
yield return new object[] { isPrepared, "MEDIUMINT", -1234567, MySqlDbType.Int32 };
#endif
yield return new object[] { isPrepared, "MEDIUMINT UNSIGNED", 1234567u, MySqlDbType.UInt24 };
yield return new object[] { isPrepared, "INT", -123456789, MySqlDbType.Int32 };
yield return new object[] { isPrepared, "INT UNSIGNED", 123456789u, MySqlDbType.UInt32 };
Expand Down
10 changes: 6 additions & 4 deletions tests/IntegrationTests/StoredProcedureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,15 +664,17 @@ OUT param2 VARCHAR(100))
}

[Theory]
[InlineData("bit(1)", 1)]
[InlineData("bit(10)", 10)]
#if !MYSQL_DATA
[InlineData("bool", 1)]
[InlineData("tinyint(1)", 1)]
[InlineData("decimal(10)", 10)]
#endif
[InlineData("char(30)", 30)]

// https://bugs.mysql.com/bug.php?id=112088
[InlineData("bit(1)", 1)]
[InlineData("bit(10)", 10)]
[InlineData("mediumtext", 0)]
#endif
[InlineData("char(30)", 30)]
[InlineData("varchar(50)", 50)]
// These return nonzero sizes for some versions of MySQL Server 8.0
// [InlineData("bit", 0)]
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<system.data>
<DbProviderFactories>
<add name="MySqlConnector" invariant="MySqlConnector" description="Async MySQL ADO.NET Connector" type="MySqlConnector.MySqlConnectorFactory, MySqlConnector, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.33.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.1.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
2 changes: 1 addition & 1 deletion tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'MySqlData' ">
<PackageReference Include="MySql.Data" Version="8.0.33" />
<PackageReference Include="MySql.Data" Version="8.1.0" />
<Compile Remove="ByteBufferWriterTests.cs;CachedProcedureTests.cs;CancellationTests.cs;ConnectionTests.cs;FakeMySqlServer.cs;FakeMySqlServerConnection.cs;LoadBalancerTests.cs;MySqlDecimalTests.cs;MySqlExceptionTests.cs;MySqlParameterCollectionNameToIndexTests.cs;NormalizeTests.cs;ServerVersionTests.cs;StatementPreparerTests.cs;TypeMapperTests.cs;UtilityTests.cs" />
<Using Include="MySql.Data.MySqlClient" />
<Using Include="MySql.Data.Types" />
Expand Down
4 changes: 0 additions & 4 deletions tests/MySqlConnector.Tests/MySqlParameterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,7 @@ public void CloneDbType()
[Fact]
public void CloneMySqlDbType()
{
#if MYSQL_DATA // https://bugs.mysql.com/bug.php?id=109682
var parameter = new MySqlParameter { MySqlDbType = MySqlDbType.Int64 };
#else
var parameter = new MySqlParameter { MySqlDbType = MySqlDbType.MediumText };
#endif
var clone = parameter.Clone();
Assert.Equal(parameter.MySqlDbType, clone.MySqlDbType);
}
Expand Down

0 comments on commit 5ade1ae

Please sign in to comment.