From 5ade1ae3662dc69d0646479c48f2ba4e01adf152 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Wed, 16 Aug 2023 09:14:18 -0700 Subject: [PATCH] Upgrade integration tests to MySql.Data 8.1.0. --- .../tutorials/migrating-from-connector-net.md | 19 ++++++++++--------- .../IntegrationTests/IntegrationTests.csproj | 2 +- .../IntegrationTests/PreparedCommandTests.cs | 5 ----- .../IntegrationTests/StoredProcedureTests.cs | 10 ++++++---- tests/IntegrationTests/app.config | 2 +- .../MySqlConnector.Tests.csproj | 2 +- .../MySqlParameterTests.cs | 4 ---- 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/docs/content/tutorials/migrating-from-connector-net.md b/docs/content/tutorials/migrating-from-connector-net.md index 46581e98f..4182b43bd 100644 --- a/docs/content/tutorials/migrating-from-connector-net.md +++ b/docs/content/tutorials/migrating-from-connector-net.md @@ -41,7 +41,7 @@ In a .NET Framework application, make the following `app.config` change to regis + type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.1.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / --> ` 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 diff --git a/tests/IntegrationTests/IntegrationTests.csproj b/tests/IntegrationTests/IntegrationTests.csproj index fdcb24726..8de202d5d 100644 --- a/tests/IntegrationTests/IntegrationTests.csproj +++ b/tests/IntegrationTests/IntegrationTests.csproj @@ -55,7 +55,7 @@ - + diff --git a/tests/IntegrationTests/PreparedCommandTests.cs b/tests/IntegrationTests/PreparedCommandTests.cs index 3a976cf56..b17ca26e4 100644 --- a/tests/IntegrationTests/PreparedCommandTests.cs +++ b/tests/IntegrationTests/PreparedCommandTests.cs @@ -373,12 +373,7 @@ public static IEnumerable 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 }; diff --git a/tests/IntegrationTests/StoredProcedureTests.cs b/tests/IntegrationTests/StoredProcedureTests.cs index f3fa66341..e74e1defb 100644 --- a/tests/IntegrationTests/StoredProcedureTests.cs +++ b/tests/IntegrationTests/StoredProcedureTests.cs @@ -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)] diff --git a/tests/IntegrationTests/app.config b/tests/IntegrationTests/app.config index 4e4e23d52..59296b86a 100644 --- a/tests/IntegrationTests/app.config +++ b/tests/IntegrationTests/app.config @@ -3,7 +3,7 @@ - + diff --git a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj index 9800da918..5a0c3b042 100644 --- a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj +++ b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj @@ -46,7 +46,7 @@ - + diff --git a/tests/MySqlConnector.Tests/MySqlParameterTests.cs b/tests/MySqlConnector.Tests/MySqlParameterTests.cs index f0a556f40..3d2309e6b 100644 --- a/tests/MySqlConnector.Tests/MySqlParameterTests.cs +++ b/tests/MySqlConnector.Tests/MySqlParameterTests.cs @@ -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); }