Skip to content

Commit 0d1d26b

Browse files
committed
Add test of Connector/NET bug.
1 parent c18facb commit 0d1d26b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
176176
* [#89159](https://bugs.mysql.com/bug.php?id=89159), [#97242](https://bugs.mysql.com/bug.php?id=97242): `MySqlDataReader` cannot outlive `MySqlCommand`
177177
* [#89335](https://bugs.mysql.com/bug.php?id=89335): `MySqlCommandBuilder.DeriveParameters` fails for `JSON` type
178178
* [#89639](https://bugs.mysql.com/bug.php?id=89639): `ReservedWords` schema contains incorrect data
179+
* [#90086](https://bugs.mysql.com/bug.php?id=90086): `MySqlDataReader` is closed by an unrelated command disposal
179180
* [#91123](https://bugs.mysql.com/bug.php?id=91123): Database names are case-sensitive when calling a stored procedure
180181
* [#91199](https://bugs.mysql.com/bug.php?id=91199): Can't insert `MySqlDateTime` values
181182
* ~~[#91751](https://bugs.mysql.com/bug.php?id=91751): `YEAR` column retrieved incorrectly with prepared command~~

tests/SideBySide/CommandTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,23 @@ public void CancelEmptyCommandIsNoop()
279279
cmd.Cancel();
280280
}
281281

282+
[SkippableFact(Baseline = "https://bugs.mysql.com/bug.php?id=90086")]
283+
public void CommandsAreIndependent()
284+
{
285+
using var connection = new MySqlConnection(AppConfig.ConnectionString);
286+
connection.Open();
287+
288+
using var cmd1 = connection.CreateCommand();
289+
cmd1.CommandText = "SELECT 1;";
290+
291+
using var cmd2 = connection.CreateCommand();
292+
cmd2.CommandText = "SELECT 'abc';";
293+
using var reader = cmd2.ExecuteReader();
294+
295+
cmd1.Dispose();
296+
Assert.True(reader.Read());
297+
}
298+
282299
private static string GetIgnoreCommandTransactionConnectionString()
283300
{
284301
#if BASELINE

0 commit comments

Comments
 (0)