Skip to content

Commit a4494b1

Browse files
committed
Update SideBySide tests to MySql.Data 8.0.22.
1 parent 902f179 commit a4494b1

File tree

10 files changed

+40
-26
lines changed

10 files changed

+40
-26
lines changed

docs/content/tutorials/migrating-from-connector-net.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
202202
* [#85185](https://bugs.mysql.com/bug.php?id=85185): `ConnectionReset=True` does not preserve connection charset
203203
* [#86263](https://bugs.mysql.com/bug.php?id=86263): Transaction isolation level affects all transactions in session
204204
* ~~[#87307](https://bugs.mysql.com/bug.php?id=87307): NextResult hangs instead of timing out~~
205-
* [#87316](https://bugs.mysql.com/bug.php?id=87316): MySqlCommand.CommandTimeout can be set to a negative value
205+
* ~~[#87316](https://bugs.mysql.com/bug.php?id=87316): MySqlCommand.CommandTimeout can be set to a negative value~~
206206
* ~~[#87868](https://bugs.mysql.com/bug.php?id=87868): `ColumnSize` in schema table is incorrect for `CHAR(36)` and `BLOB` columns~~
207207
* ~~[#87876](https://bugs.mysql.com/bug.php?id=87876): `IsLong` is schema table is incorrect for `LONGTEXT` and `LONGBLOB` columns~~
208208
* ~~[#88058](https://bugs.mysql.com/bug.php?id=88058): `decimal(n, 0)` has wrong `NumericPrecision`~~
@@ -213,7 +213,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
213213
* [#89085](https://bugs.mysql.com/bug.php?id=89085): `MySqlConnection.Database` not updated after `USE database;`
214214
* ~~[#89159](https://bugs.mysql.com/bug.php?id=89159), [#97242](https://bugs.mysql.com/bug.php?id=97242): `MySqlDataReader` cannot outlive `MySqlCommand`~~
215215
* [#89335](https://bugs.mysql.com/bug.php?id=89335): `MySqlCommandBuilder.DeriveParameters` fails for `JSON` type
216-
* [#89639](https://bugs.mysql.com/bug.php?id=89639): `ReservedWords` schema contains incorrect data
216+
* ~~[#89639](https://bugs.mysql.com/bug.php?id=89639): `ReservedWords` schema contains incorrect data~~
217217
* ~~[#90086](https://bugs.mysql.com/bug.php?id=90086): `MySqlDataReader` is closed by an unrelated command disposal~~
218218
* [#91123](https://bugs.mysql.com/bug.php?id=91123): Database names are case-sensitive when calling a stored procedure
219219
* [#91199](https://bugs.mysql.com/bug.php?id=91199): Can't insert `MySqlDateTime` values
@@ -227,7 +227,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
227227
* [#92734](https://bugs.mysql.com/bug.php?id=92734): `MySqlParameter.Clone` doesn't copy all property values
228228
* [#92789](https://bugs.mysql.com/bug.php?id=92789): Illegal connection attributes written for non-ASCII values
229229
* ~~[#92912](https://bugs.mysql.com/bug.php?id=92912): `MySqlDbType.LongText` values encoded incorrectly with prepared statements~~
230-
* [#92982](https://bugs.mysql.com/bug.php?id=92982), [#93399](https://bugs.mysql.com/bug.php?id=93399): `FormatException` thrown when connecting to MySQL Server 8.0.13
230+
* ~~[#92982](https://bugs.mysql.com/bug.php?id=92982), [#93399](https://bugs.mysql.com/bug.php?id=93399)~~: `FormatException` thrown when connecting to MySQL Server 8.0.13~~
231231
* [#93047](https://bugs.mysql.com/bug.php?id=93047): `MySqlDataAdapter` throws timeout exception when an error occurs
232232
* ~~[#93202](https://bugs.mysql.com/bug.php?id=93202): Connector runs `SHOW VARIABLES` when connection is made~~
233233
* [#93220](https://bugs.mysql.com/bug.php?id=93220): Can’t call FUNCTION when parameter name contains parentheses
@@ -254,7 +254,10 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
254254
* [#97872](https://bugs.mysql.com/bug.php?id=97872): `KeepAlive` in connection string throws exception on .NET Core
255255
* ~~[#98322](https://bugs.mysql.com/bug.php?id=98322): `new MySqlConnection(null)` throws `NullReferenceException`~~
256256
* [#99091](https://bugs.mysql.com/bug.php?id=99091): Unexpected return value getting integer for `TINYINT(1)` column
257-
* [#99793](https://bugs.mysql.com/bug.php?id=99793): Prepared stored procedure command doesn't verify parameter types
258-
* [#100159](https://bugs.mysql.com/bug.php?id=100159): SQL with DateTime parameter returns String value
259-
* [#100208](https://bugs.mysql.com/bug.php?id=100208): `GetSchema("Procedures")` returns `ROUTINE_DEFINITION` of `"System.Byte[]"`
260-
* [#100218](https://bugs.mysql.com/bug.php?id=100218): `TIME(n)` microsecond values deserialized incorrectly with prepared command
257+
* ~~[#99793](https://bugs.mysql.com/bug.php?id=99793): Prepared stored procedure command doesn't verify parameter types~~
258+
* ~~[#100159](https://bugs.mysql.com/bug.php?id=100159): SQL with DateTime parameter returns String value~~
259+
* ~~[#100208](https://bugs.mysql.com/bug.php?id=100208): `GetSchema("Procedures")` returns `ROUTINE_DEFINITION` of `"System.Byte[]"`~~
260+
* ~~[#100218](https://bugs.mysql.com/bug.php?id=100218): `TIME(n)` microsecond values deserialized incorrectly with prepared command~~
261+
* ~~[#100306](https://bugs.mysql.com/bug.php?id=100306): `Command.Prepare` sends wrong statement to server~~
262+
* [#101252](https://bugs.mysql.com/bug.php?id=101252): Can't query `CHAR(36)` column containing `NULL`
263+
* [#101253](https://bugs.mysql.com/bug.php?id=101253): Default value for `MySqlParameter.Value` changed from null to `0`

tests/SideBySide/CommandTimeoutTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ public void DefaultCommandTimeoutIsInherited(int defaultCommandTimeout)
3838
Assert.Equal(defaultCommandTimeout, command.CommandTimeout);
3939
}
4040

41-
[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=87316")]
41+
[Fact]
4242
public void NegativeCommandTimeout()
4343
{
4444
using var command = m_connection.CreateCommand();
45+
#if BASELINE
46+
Assert.Throws<ArgumentException>(() => command.CommandTimeout = -1);
47+
#else
4548
Assert.Throws<ArgumentOutOfRangeException>(() => command.CommandTimeout = -1);
49+
#endif
4650
}
4751

4852
[Fact]

tests/SideBySide/DataTypes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public void QueryString(string column, string[] expected)
357357
}
358358
const string c_251ByteString = "This string has exactly 251 characters in it. The encoded length is stored as 0xFC 0xFB 0x00. 0xFB (i.e., 251) is the sentinel byte indicating \"this field is null\". Incorrectly interpreting the (decoded) length as the sentinel byte would corrupt data.";
359359

360-
[Theory]
360+
[SkippableTheory(Baseline = "https://bugs.mysql.com/bug.php?id=101252")]
361361
[InlineData("guid", "CHAR(36)", new object[] { null, "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-c000-000000000046", "fd24a0e8-c3f2-4821-a456-35da2dc4bb8f", "6A0E0A40-6228-11D3-A996-0050041896C8" })]
362362
[InlineData("guidbin", "CHAR(36)", new object[] { null, "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-c000-000000000046", "fd24a0e8-c3f2-4821-a456-35da2dc4bb8f", "6A0E0A40-6228-11D3-A996-0050041896C8" })]
363363
public void QueryGuid(string column, string dataTypeName, object[] expected)
@@ -393,7 +393,7 @@ public void QueryChar(string column, string[] expected)
393393
}
394394
}
395395

396-
[Theory]
396+
[SkippableTheory(Baseline = "https://bugs.mysql.com/bug.php?id=101252")]
397397
[InlineData(false)]
398398
[InlineData(true)]
399399
public void QueryBinaryGuid(bool oldGuids)

tests/SideBySide/ParameterTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ public void ConstructorNameType()
125125
Assert.Equal(MySqlDbType.Double, parameter.MySqlDbType);
126126
Assert.Equal(DbType.Double, parameter.DbType);
127127
Assert.False(parameter.IsNullable);
128+
#if BASELINE // https://bugs.mysql.com/bug.php?id=101253
129+
Assert.Equal(0, parameter.Value);
130+
#else
128131
Assert.Null(parameter.Value);
132+
#endif
129133
Assert.Equal(ParameterDirection.Input, parameter.Direction);
130134
Assert.Equal(0, parameter.Precision);
131135
Assert.Equal(0, parameter.Scale);
@@ -150,7 +154,11 @@ public void ConstructorNameTypeSize()
150154
Assert.Equal(MySqlDbType.Double, parameter.MySqlDbType);
151155
Assert.Equal(DbType.Double, parameter.DbType);
152156
Assert.False(parameter.IsNullable);
157+
#if BASELINE // https://bugs.mysql.com/bug.php?id=101253
158+
Assert.Equal(0, parameter.Value);
159+
#else
153160
Assert.Null(parameter.Value);
161+
#endif
154162
Assert.Equal(ParameterDirection.Input, parameter.Direction);
155163
Assert.Equal(0, parameter.Precision);
156164
Assert.Equal(0, parameter.Scale);
@@ -175,7 +183,11 @@ public void ConstructorNameTypeSizeSourceColumn()
175183
Assert.Equal(MySqlDbType.Int32, parameter.MySqlDbType);
176184
Assert.Equal(DbType.Int32, parameter.DbType);
177185
Assert.False(parameter.IsNullable);
186+
#if BASELINE // https://bugs.mysql.com/bug.php?id=101253
187+
Assert.Equal(0, parameter.Value);
188+
#else
178189
Assert.Null(parameter.Value);
190+
#endif
179191
Assert.Equal(ParameterDirection.Input, parameter.Direction);
180192
Assert.Equal(0, parameter.Precision);
181193
Assert.Equal(0, parameter.Scale);

tests/SideBySide/PreparedCommandTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,9 @@ public static IEnumerable<object[]> GetInsertAndQueryData()
370370
yield return new object[] { isPrepared, "BINARY(5)", new byte[] { 5, 6, 7, 8, 9 }, MySqlDbType.Binary };
371371
yield return new object[] { isPrepared, "VARBINARY(100)", new byte[] { 7, 8, 9, 10 }, MySqlDbType.VarBinary };
372372
yield return new object[] { isPrepared, "BLOB", new byte[] { 5, 4, 3, 2, 1 }, MySqlDbType.Blob };
373+
#if !BASELINE // https://bugs.mysql.com/bug.php?id=101252
373374
yield return new object[] { isPrepared, "CHAR(36)", new Guid("00112233-4455-6677-8899-AABBCCDDEEFF"), MySqlDbType.Guid };
375+
#endif
374376
yield return new object[] { isPrepared, "FLOAT", 12.375f, MySqlDbType.Float };
375377
yield return new object[] { isPrepared, "DOUBLE", 14.21875, MySqlDbType.Double };
376378
yield return new object[] { isPrepared, "DECIMAL(9,3)", 123.45m, MySqlDbType.Decimal };

tests/SideBySide/QueryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ public void GetIntForTinyInt1(bool treatTinyAsBoolean, bool prepare)
12551255
}
12561256

12571257
#if !NETCOREAPP1_1_2
1258-
[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=100159")]
1258+
[Fact]
12591259
public void QueryDateTimeLiteral()
12601260
{
12611261
using var connection = new MySqlConnection(AppConfig.ConnectionString);

tests/SideBySide/SchemaProviderTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ public void ReservedWordsSchema(string schemaName)
3838
Assert.NotNull(table);
3939
Assert.Single(table.Columns);
4040
Assert.Equal("ReservedWord", table.Columns[0].ColumnName);
41-
#if !BASELINE
42-
// https://bugs.mysql.com/bug.php?id=89639
4341
Assert.Contains("CREATE", table.Rows.Cast<DataRow>().Select(x => (string) x[0]));
44-
#endif
4542
}
4643

4744
[Fact]

tests/SideBySide/SideBySide.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</ItemGroup>
4343

4444
<ItemGroup Condition=" '$(Configuration)' == 'Baseline' ">
45-
<PackageReference Include="MySql.Data" Version="8.0.21" />
45+
<PackageReference Include="MySql.Data" Version="8.0.22" />
4646
</ItemGroup>
4747

4848
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1.2' ">

tests/SideBySide/StoredProcedureTests.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ public async Task GetColumnSchemaForNoResultSet(bool ignorePrepare)
225225

226226
[Theory]
227227
[InlineData(true)]
228-
#if !BASELINE
229-
[InlineData(false)] // https://bugs.mysql.com/bug.php?id=99793
230-
#endif
228+
[InlineData(false)]
231229
public async Task StoredProcedureOutIncorrectType(bool ignorePrepare)
232230
{
233231
using var connection = CreateOpenConnection(ignorePrepare);
@@ -241,8 +239,11 @@ public async Task StoredProcedureOutIncorrectType(bool ignorePrepare)
241239
Direction = ParameterDirection.Output,
242240
});
243241

244-
await cmd.PrepareAsync();
245-
await Assert.ThrowsAsync<FormatException>(cmd.ExecuteNonQueryAsync);
242+
await Assert.ThrowsAsync<FormatException>(async () =>
243+
{
244+
await cmd.PrepareAsync();
245+
await cmd.ExecuteNonQueryAsync();
246+
});
246247
}
247248

248249
[Theory]
@@ -697,12 +698,7 @@ public void ProceduresSchema(string procedureName, string procedureType, string
697698
Assert.Equal(DBNull.Value, row["DTD_IDENTIFIER"]);
698699
else
699700
Assert.Equal(dtdIdentifier, ((string) row["DTD_IDENTIFIER"]).Split(' ')[0]);
700-
#if BASELINE
701-
// https://bugs.mysql.com/bug.php?id=100208
702-
Assert.NotEmpty(routineDefinition);
703-
#else
704701
Assert.Equal(routineDefinition, NormalizeSpaces((string) row["ROUTINE_DEFINITION"]));
705-
#endif
706702
Assert.Equal(isDeterministic, row["IS_DETERMINISTIC"]);
707703
Assert.Equal(dataAccess, ((string) row["SQL_DATA_ACCESS"]).Replace('_', ' '));
708704
}

tests/SideBySide/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<system.data>
44
<DbProviderFactories>
55
<add name="MySqlConnector" invariant="MySqlConnector" description="Async MySQL ADO.NET Connector" type="MySqlConnector.MySqlConnectorFactory, MySqlConnector, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92" />
6-
<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.20.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
6+
<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.22.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
77
</DbProviderFactories>
88
</system.data>
99
</configuration>

0 commit comments

Comments
 (0)