Bug #121584 Connector/NET DbParameter defaults differ from ADO.NET
Submitted: 22 Oct 16:14
Reporter: Alaric Dailey (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:Connector/NET 8.4.0, 9.7.0, and 26.10.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: ado-net, conformance, Connector-NET

[22 Oct 16:14] Alaric Dailey
Description:
MySqlParameter does not use the ADO.NET defaults required by DbParameter. ParameterName should default to an empty string, and SourceVersion should default to DataRowVersion.Current. The current Connector/NET defaults differ. This was found by pengdows.AdoNetApiTest.conformance.

How to repeat:
1. Create a new MySqlParameter without assigning ParameterName or SourceVersion.
2. Read parameter.ParameterName and parameter.SourceVersion.
3. Observe that ParameterName is not the empty string and/or SourceVersion is not DataRowVersion.Current.

The conformance regression tests are Parameter.ParameterName_default_is_empty_string, Parameter.Parameter_default_ParameterName_is_empty_string, and Parameter.Parameter_default_SourceVersion_is_Current in pengdows.AdoNetApiTest.conformance.

Suggested fix:
Initialize the parameter name to String.Empty and SourceVersion to DataRowVersion.Current, with regression tests for the documented defaults.