Bug #98322 | MySqlConnection(null) now throws NullReferenceException | ||
---|---|---|---|
Submitted: | 22 Jan 2020 5:56 | Modified: | 3 Apr 2020 20:25 |
Reporter: | Bradley Grainger (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 8.0.19 | OS: | Windows (10) |
Assigned to: | CPU Architecture: | Any |
[22 Jan 2020 5:56]
Bradley Grainger
[22 Jan 2020 6:18]
Bradley Grainger
A reason for restoring the old behaviour (no exception) is that the following code works: using var connection = new MySqlConnection("server=localhost"); connection.ConnectionString = null; Assert.Equal("", connection.ConnectionString); // passes If "new MySqlConnection(null)" is invalid then "connection.ConnectionString = null;" should have the same behaviour.
[22 Jan 2020 7:06]
MySQL Verification Team
Hello Bradley, Thank you for the report and test case. regards, Umesh
[3 Apr 2020 20:25]
Christine Cole
Posted by developer: Fixed as of the upcoming MySQL Connector/NET 8.0.21 release, and here's the proposed changelog entry from the documentation team: In Connector/NET 8.0.19, calling new MySqlConnection(null) returned NullReferenceException, rather than returning an object with a ConnectionString property equal to String.Empty, as the previous versions of Connector/NET did. This fix restores the earlier behavior. Thank you for the bug report.