Bug #104910 MySqlConnectionStringBuilder.TryGetValue always returns false
Submitted: 10 Sep 20:03 Modified: 14 Sep 10:25
Reporter: Bradley Grainger (OCA) Email Updates:
Status: Verified Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version:8.0.26 OS:Microsoft Windows (10)
Assigned to: CPU Architecture:Any

[10 Sep 20:03] Bradley Grainger
DbConnectionStringBuilder "lets developers safely retrieve a value from a DbConnectionStringBuilder without needing to first call the ContainsKey method" (https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbconnectionstringbuilder.t...).

The MySQL Connector/NET implementation of TryGetValue always returns false.

How to repeat:
Run the following C# code:

var csb = new MySqlConnectionStringBuilder { MinimumPoolSize = 1 };

// getting properties by string does work
var contains = csb.ContainsKey("Minimum Pool Size"); // returns true
var size = csb["Minimum Pool Size"]; // returns 1

// returns false (and sets value to null); expected 'true' and '1'
csb.TryGetValue("Minimum Pool Size", out var value);
[14 Sep 10:25] MySQL Verification Team
Hello Bradley Grainger,

Thank you for the bug report.
Verified as described.

Ashwini Patil