Bug 44843 - SqlCommand.ExecuteReaderAsync throws NotImplementedException
Summary: SqlCommand.ExecuteReaderAsync throws NotImplementedException
Status: VERIFIED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-09-28 19:36 UTC by Jon Goldberger [MSFT]
Modified: 2016-10-04 19:05 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: 4.4.2.11


Attachments

Description Jon Goldberger [MSFT] 2016-09-28 19:36:04 UTC
## Description

A customer reports that after updating to Cycle 8 that SqlCommand.ExecuteReaderAsync is throwing a NotImplementedException where it did not in Cycle 7.

A bit of investigation revealed that prior to Mono 4.6.0, there was no SqlCommand.ExecuteReaderAsync (namespace System.Data.SqlClient) implementation and instead that method, with overloads, was inherited from the abstract base class DbCommand.ExecuteReaderAsync (namespace System.Data.Common) and ExecuteReaderAsync is implemented in DbCommand so prior to Mono 4.6 calling SqlCommand.ExecuteReaderAsync worked as the implementation in DbCommand was used. But in Mono 4.6 (and in the master branch) the implementations in SqlCommand.ExecuteReaderAsync hide the base implementations and the new implementation only throws a NotImplementedException.

See Mono 4.6 System.Data.SqlClient.SqlCommand.ExecuteReaderAsync:
https://github.com/mono/mono/blob/mono-4.6.0-branch-c8sr0/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs#L514

and Mono 4.5.1 System.Data.SqlClient.SqlCommand.ExecuteReader (the Async version does not exist)
https://github.com/mono/mono/blob/mono-4.5.1-branch/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs#L487

and also Mono master System.Data.Common.DbCommand.ExecuteReader:
https://github.com/mono/mono/blob/master/mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs#L228

## Steps to reproduce

I don't think this is needed, but there is a test project I can provide from the desk case if need be. 

## Environment

Again I don't think this is needed, but issue occurs with latest C8 and C8 SR0 builds, which include Mono 4.6.
Comment 2 Marek Safar 2016-09-30 10:11:21 UTC
Fixed in master and Mono 4.8
Comment 6 Mohit Kheterpal 2016-10-04 18:13:19 UTC
I have checked this issue with latest build of master i.e. MonoFramework-MDK-4.9.0.363.macos10.xamarin.universal_633af27d6800a6a5c050c9e4c50a0d8b67c97c20.pkg and observed that this issue still exist 

Exception Error : https://gist.github.com/Mohit-Kheterpal/eac79ce416507c82376230718b8b8284

Environment info and IDE Logs : https://gist.github.com/Mohit-Kheterpal/d8dee622aa59dc9417bb2111d75159ba

Application output : https://gist.github.com/Mohit-Kheterpal/c979ed8c3866c9bc2b8da961fd2c4aa6

Hence, reopening this issue.

thanks
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-04 18:47:58 UTC
You tested on iOS.  The fix is in the class libraries, so the version of Mono that you would need to report as having tested would be the version included _within_ Xamarin.iOS.

You tested with Xamarin.iOS 66915a0, which includes Mono 8f689a60fe814554e4958d67582ba5ec230c03f5 [1].

Mono 8f689a60fe814554e4958d67582ba5ec230c03f5 predates the changes mentioned in Comment 2 [2]:
https://github.com/mono/mono/blob/8f689a60fe814554e4958d67582ba5ec230c03f5/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs



[1] https://github.com/xamarin/xamarin-macios/tree/66915a01c028b7a9f749c72de9fd353307e56437/external

[2] https://github.com/mono/mono/commit/aebd704d799a1081cd71f5e58d7a7a96d6f92663
Comment 8 Mohit Kheterpal 2016-10-04 19:05:02 UTC
I got the expected output with Mono sample provided in comment 5 using MonoFramework-MDK-4.9.0.363.macos10.xamarin.universal_633af27d6800a6a5c050c9e4c50a0d8b67c97c20.pkg..

Hello World!
Results: 232	139
Results: 233	128
Results: 234	109
Results: 235	108
Results: 236	135

Hence closing this issue by marking it as Verified.

thanks

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.


Create a new report for Bug 44843 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Related Links: