Skip to content

Commit 2becd04

Browse files
committed
Add some more Connector/NET bugs fixed in this library.
1 parent 34dd8e5 commit 2becd04

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ supported in MySqlConnector, see the [Connection Options](connection-options)
4141

4242
### Bugs present in Connector/NET that are fixed in MySqlConnector
4343

44+
* [#66476](https://bugs.mysql.com/bug.php?id=66476): Connection pool uses queue instead of stack
4445
* [#70111](https://bugs.mysql.com/bug.php?id=70111): `Async` methods execute synchronously
4546
* [#70686](https://bugs.mysql.com/bug.php?id=70686): `TIME(3)` and `TIME(6)` fields serialize milliseconds incorrectly
47+
* [#73610](https://bugs.mysql.com/bug.php?id=73610): Invalid password exception has wrong number
4648
* [#73788](https://bugs.mysql.com/bug.php?id=73788): Can't use `DateTimeOffset`
4749
* [#77421](https://bugs.mysql.com/bug.php?id=77421): Connection is not reset when pulled from the connection pool
50+
* [#78426](https://bugs.mysql.com/bug.php?id=78426): Unknown database exception has wrong number
4851
* [#78760](https://bugs.mysql.com/bug.php?id=78760): Error when using tabs and newlines in SQL statements
4952
* [#78917](https://bugs.mysql.com/bug.php?id=78917): `TINYINT(1)` values start being returned as `sbyte` after `NULL`
5053
* [#81650](https://bugs.mysql.com/bug.php?id=81650): `Server` connection string option may now contain multiple, comma separated hosts that will be tried in order until a connection succeeds
5154
* [#84220](https://bugs.mysql.com/bug.php?id=84220): Cannot call a stored procedure with `.` in its name
55+
* [#85185](https://bugs.mysql.com/bug.php?id=85185): `ConnectionReset=True` does not preserve connection charset

tests/SideBySide/ConnectSync.cs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,52 @@ public void ConnectBadPort()
5151
}
5252
}
5353

54+
[Fact]
55+
public void ConnectBadDatabase()
56+
{
57+
var csb = AppConfig.CreateConnectionStringBuilder();
58+
csb.Database = "wrong_database";
59+
using (var connection = new MySqlConnection(csb.ConnectionString))
60+
{
61+
try
62+
{
63+
connection.Open();
64+
Assert.True(false);
65+
}
66+
catch (MySqlException ex)
67+
{
68+
#if BASELINE
69+
// https://bugs.mysql.com/bug.php?id=78426
70+
Assert.NotNull(ex);
71+
#else
72+
Assert.Equal((int) MySqlErrorCode.UnknownDatabase, ex.Number);
73+
#endif
74+
}
75+
Assert.Equal(ConnectionState.Closed, connection.State);
76+
}
77+
}
78+
5479
[Fact]
5580
public void ConnectBadPassword()
5681
{
5782
var csb = AppConfig.CreateConnectionStringBuilder();
5883
csb.Password = "wrong";
5984
using (var connection = new MySqlConnection(csb.ConnectionString))
6085
{
61-
Assert.Throws<MySqlException>(() => connection.Open());
86+
try
87+
{
88+
connection.Open();
89+
Assert.True(false);
90+
}
91+
catch (MySqlException ex)
92+
{
93+
#if BASELINE
94+
// https://bugs.mysql.com/bug.php?id=73610
95+
Assert.NotNull(ex);
96+
#else
97+
Assert.Equal((int) MySqlErrorCode.AccessDenied, ex.Number);
98+
#endif
99+
}
62100
Assert.Equal(ConnectionState.Closed, connection.State);
63101
}
64102
}

0 commit comments

Comments
 (0)