Skip to content

Commit 774361b

Browse files
committed
Update MySql.Data to 8.0.30.
1 parent c9f0624 commit 774361b

File tree

9 files changed

+38
-31
lines changed

9 files changed

+38
-31
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
197197
* [#37283](https://bugs.mysql.com/bug.php?id=37283), [#70587](https://bugs.mysql.com/bug.php?id=70587): Distributed transactions are not supported
198198
* [#50773](https://bugs.mysql.com/bug.php?id=50773): Can’t use multiple connections within one TransactionScope
199199
* [#61477](https://bugs.mysql.com/bug.php?id=61477): `ColumnOrdinal` in schema table is 1-based
200-
* [#66476](https://bugs.mysql.com/bug.php?id=66476): Connection pool uses queue instead of stack
200+
* ~~[#66476](https://bugs.mysql.com/bug.php?id=66476), [#106368](https://bugs.mysql.com/bug.php?id=106368): Connection pool uses queue instead of stack~~
201201
* [#70111](https://bugs.mysql.com/bug.php?id=70111): `Async` methods execute synchronously
202202
* ~~[#70686](https://bugs.mysql.com/bug.php?id=70686): `TIME(3)` and `TIME(6)` fields serialize milliseconds incorrectly~~
203203
* [#72494](https://bugs.mysql.com/bug.php?id=72494), [#83330](https://bugs.mysql.com/bug.php?id=83330): EndOfStreamException inserting large blob with UseCompression=True
@@ -288,14 +288,14 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
288288
* ~~[#103430](https://bugs.mysql.com/bug.php?id=103430): Can't connect using named pipe on Windows~~
289289
* ~~[#103801](https://bugs.mysql.com/bug.php?id=103801): `TimeSpan` parameters lose microseconds with prepared statement~~
290290
* [#103819](https://bugs.mysql.com/bug.php?id=103819): Can't use `StringBuilder` containing non-BMP characters as `MySqlParameter.Value`
291-
* [#104910](https://bugs.mysql.com/bug.php?id=104910): `MySqlConnectionStringBuilder.TryGetValue` always returns `false`
292-
* [#104913](https://bugs.mysql.com/bug.php?id=104913): Cannot execute stored procedure with backtick in name
291+
* ~~[#104910](https://bugs.mysql.com/bug.php?id=104910): `MySqlConnectionStringBuilder.TryGetValue` always returns `false`~~
292+
* ~~[#104913](https://bugs.mysql.com/bug.php?id=104913): Cannot execute stored procedure with backtick in name~~
293293
* ~~[#105209](https://bugs.mysql.com/bug.php?id=105209): Timespan value of zero can't be read with prepared command~~
294294
* [#105728](https://bugs.mysql.com/bug.php?id=105728): Named command parameters override query attribute values
295295
* ~~[#105730](https://bugs.mysql.com/bug.php?id=105730): `MySqlCommand.Clone` doesn't clone attributes~~
296296
* ~~[#105768](https://bugs.mysql.com/bug.php?id=105768): `MySqlCommandBuilder` doesn't support tables with `BIGINT UNSIGNED` primary key~~
297297
* [#105965](https://bugs.mysql.com/bug.php?id=105965): `MySqlParameterCollection.Add(object)` has quadratic performance
298298
* ~~[#106242](https://bugs.mysql.com/bug.php?id=106242): `MySqlConnection.Open` throws `AggregateException` instead of `MySqlException`~~
299-
* [#106243](https://bugs.mysql.com/bug.php?id=106243): `CancellationToken` doesn't cancel `MySqlConnection.OpenAsync`
299+
* ~~[#106243](https://bugs.mysql.com/bug.php?id=106243): `CancellationToken` doesn't cancel `MySqlConnection.OpenAsync`~~
300300
* ~~[#106244](https://bugs.mysql.com/bug.php?id=106244): `MySqlDataReader.GetFieldValue<Stream>` throws `InvalidCastException`~~
301-
* [#106247](https://bugs.mysql.com/bug.php?id=106247): Can't use `MySqlDbType.Enum` or `MySqlDbType.Set` with prepared command
301+
* [#106247](https://bugs.mysql.com/bug.php?id=106247): Can't use ~~`MySqlDbType.Enum` or~~ `MySqlDbType.Set` with prepared command

tests/MySqlConnector.Tests/MySqlConnectionStringBuilderTests.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,14 @@ public void NamedProperty(string propertyName, object value)
532532
{
533533
var csb = new MySqlConnectionStringBuilder();
534534
#if !BASELINE
535-
// Connector/NET sets all properties to default values
536535
Assert.False(csb.ContainsKey(propertyName));
537-
#endif
538536
Assert.False(csb.TryGetValue(propertyName, out var setValue));
539537
Assert.Null(setValue);
538+
#else
539+
// Connector/NET sets all properties to default values
540+
Assert.True(csb.ContainsKey(propertyName));
541+
Assert.True(csb.TryGetValue(propertyName, out var setValue));
542+
#endif
540543

541544
ICustomTypeDescriptor typeDescriptor = csb;
542545
var propertyDescriptor = typeDescriptor.GetProperties().Cast<PropertyDescriptor>().SingleOrDefault(x => x.DisplayName == propertyName);
@@ -548,14 +551,21 @@ public void NamedProperty(string propertyName, object value)
548551
csb.ConnectionString = propertyName + " = " + stringValue;
549552

550553
Assert.True(csb.ContainsKey(propertyName));
551-
#if !BASELINE
552-
// https://bugs.mysql.com/bug.php?id=104910
554+
553555
Assert.True(csb.TryGetValue(propertyName, out setValue));
556+
#if !BASELINE
554557
Assert.Equal(stringValue, setValue);
558+
#else
559+
Assert.Equal(value, setValue);
560+
#endif
555561

556562
var propertyDescriptorValue = propertyDescriptor.GetValue(csb);
563+
#if !BASELINE
557564
Assert.Equal(stringValue, propertyDescriptorValue);
565+
#else
566+
Assert.Equal(value, propertyDescriptorValue);
558567
#endif
568+
559569
Assert.Equal(value, csb[propertyName]);
560570
}
561571
}

tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup Condition=" '$(Configuration)' == 'Baseline' ">
35-
<PackageReference Include="MySql.Data" Version="8.0.29" />
35+
<PackageReference Include="MySql.Data" Version="8.0.30" />
3636
<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" />
3737
</ItemGroup>
3838

tests/SideBySide/ConnectAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task ConnectBadPassword()
5151
Assert.Equal(ConnectionState.Closed, connection.State);
5252
}
5353

54-
[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=106243")]
54+
[Fact]
5555
public async Task ConnectCanceled()
5656
{
5757
using var cts = new CancellationTokenSource();

tests/SideBySide/ConnectionPool.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,43 @@ namespace SideBySide;
33
public class ConnectionPool : IClassFixture<DatabaseFixture>
44
{
55
[Theory]
6-
[InlineData(false, 11, 0L)]
7-
[InlineData(true, 12, 1L)]
6+
[InlineData(false, 11, 1L)]
7+
[InlineData(true, 12, null)]
88
#if BASELINE
99
// baseline default behaviour is to not reset the connection, which trades correctness for speed
1010
// see bug report at http://bugs.mysql.com/bug.php?id=77421
11-
[InlineData(null, 13, 0L)]
12-
#else
1311
[InlineData(null, 13, 1L)]
12+
#else
13+
[InlineData(null, 13, null)]
1414
#endif
15-
public void ResetConnection(object connectionReset, int poolSize, long expected)
15+
public void ResetConnection(object connectionReset, int poolSize, object expected)
1616
{
1717
var csb = AppConfig.CreateConnectionStringBuilder();
1818
csb.Pooling = true;
1919
csb.MaximumPoolSize = (uint) poolSize; // use a different pool size to create a unique connection string to force a unique pool to be created
20+
csb.AllowUserVariables = true;
2021

2122
if (connectionReset is bool connectionResetValue)
2223
csb.ConnectionReset = connectionResetValue;
2324

25+
int serverThread;
2426
using (var connection = new MySqlConnection(csb.ConnectionString))
2527
{
2628
connection.Open();
29+
serverThread = connection.ServerThread;
2730
using var command = connection.CreateCommand();
28-
command.CommandText = "select @@autocommit;";
29-
Assert.Equal(1L, command.ExecuteScalar());
30-
}
31-
32-
using (var connection = new MySqlConnection(csb.ConnectionString))
33-
{
34-
connection.Open();
35-
using var command = connection.CreateCommand();
36-
command.CommandText = "SET autocommit=0;";
31+
command.CommandText = "set @tmp_connection_reset = 1;";
3732
command.ExecuteNonQuery();
3833
}
3934

4035
using (var connection = new MySqlConnection(csb.ConnectionString))
4136
{
4237
connection.Open();
38+
Assert.Equal(serverThread, connection.ServerThread);
4339
using var command = connection.CreateCommand();
44-
command.CommandText = "select @@autocommit;";
45-
Assert.Equal(expected, command.ExecuteScalar());
40+
command.CommandText = "select @tmp_connection_reset;";
41+
var actual = command.ExecuteScalar();
42+
Assert.Equal(expected, actual is DBNull ? null : actual);
4643
}
4744
}
4845

tests/SideBySide/PreparedCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ public static IEnumerable<object[]> GetInsertAndQueryData()
396396
yield return new object[] { isPrepared, "TEXT", "testing testing", MySqlDbType.Text };
397397
yield return new object[] { isPrepared, "DATE", new DateTime(2018, 7, 23), MySqlDbType.Date };
398398
yield return new object[] { isPrepared, "DATETIME(3)", new DateTime(2018, 7, 23, 20, 46, 52, 123), MySqlDbType.DateTime };
399+
yield return new object[] { isPrepared, "ENUM('small', 'medium', 'large')", "medium", MySqlDbType.Enum };
399400
#if !BASELINE
400401
// https://bugs.mysql.com/bug.php?id=106247
401-
yield return new object[] { isPrepared, "ENUM('small', 'medium', 'large')", "medium", MySqlDbType.Enum };
402402
yield return new object[] { isPrepared, "SET('one','two','four','eight')", "two,eight", MySqlDbType.Set };
403403
#endif
404404
#if !BASELINE

tests/SideBySide/SideBySide.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</ItemGroup>
5353

5454
<ItemGroup Condition=" '$(Configuration)' == 'Baseline' ">
55-
<PackageReference Include="MySql.Data" Version="8.0.29" />
55+
<PackageReference Include="MySql.Data" Version="8.0.30" />
5656
<Using Include="MySql.Data.MySqlClient" />
5757
</ItemGroup>
5858

tests/SideBySide/StoredProcedureTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ public void EnumProcedure(bool prepare)
840840
Assert.False(reader.Read());
841841
}
842842

843-
[SkippableTheory(Baseline = "https://bugs.mysql.com/bug.php?id=104913")]
843+
[Theory]
844844
[InlineData("`a b`")]
845845
[InlineData("`a.b`")]
846846
[InlineData("`a``b`")]

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.29.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.30.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
77
</DbProviderFactories>
88
</system.data>
99
</configuration>

0 commit comments

Comments
 (0)