Bug #97300 | GetSchemaTable returns unexpected table when sproc has output parameters | ||
---|---|---|---|
Submitted: | 20 Oct 2019 16:16 | Modified: | 1 May 2020 16:12 |
Reporter: | Bradley Grainger (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 8.0.18 | OS: | Windows (10) |
Assigned to: | CPU Architecture: | Any |
[20 Oct 2019 16:16]
Bradley Grainger
[20 Oct 2019 20:09]
Bradley Grainger
There are additional unexpected behaviours: using (var reader = await cmd.ExecuteReaderAsync()) { reader.Read(); // returns false Console.WriteLine(reader.GetFieldType(0)); // prints System.Int32 Console.WriteLine(reader.GetName(0)); // prints @_cnet_param_value Console.WriteLine(reader.GetInt32(0)); // prints 1 } Since MySqlDataReader.Read() returned false, it is expected that all data access functions should fail because there are no more rows.
[21 Oct 2019 5:47]
MySQL Verification Team
Hello Bradley, Thank you for the report and test case. regards, Umesh
[21 Oct 2019 14:21]
Bradley Grainger
Additionally: Console.WriteLine(reader.HasRows); // prints true; expected false Console.WriteLine(reader.FieldCount); // prints 1; expected 0
[30 Apr 2020 17:04]
Gustavo Cuatepotzo
Posted by developer: Added code to clean up the internal ResulSet in DataReader
[1 May 2020 16:12]
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: An expected empty result set generated by executing MySQLDataReader for a stored procedure instead returned a data table containing the @_cnet_param_value column. This fix eliminates an internal error that affected the result set and now GetSchemaTable() returns a null value as expected. Thank you for the bug report.