Bug 43147 - SqlDataReader can't handle stored procedure parameter timestamp OUTPUT
Summary: SqlDataReader can't handle stored procedure parameter timestamp OUTPUT
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 4.5.X
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-08-06 17:25 UTC by Tiago Freitas Leal
Modified: 2018-02-22 22:22 UTC (History)
2 users (show)

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


Attachments
POCO object class (1.24 KB, text/plain)
2016-08-06 17:25 UTC, Tiago Freitas Leal
Details
Stored Procedure (783 bytes, text/x-csrc)
2016-08-06 17:30 UTC, Tiago Freitas Leal
Details


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.

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.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Tiago Freitas Leal 2016-08-06 17:25:57 UTC
Created attachment 16929 [details]
POCO object class

I have a table Buyers with columns
Id int,
Name nvarchar(50),
BuyerRowVersion timestamp

I have a POCO object with properties
public int Id { get; set; }
public string Name { get; set; }
public byte[] BuyerRowVersion { get; set; }

When I create a row in the DB, everything runs ok under .NET but on Mono it throws

Unhandled Exception:
System.NotSupportedException: Unknown Type : timestamp
  at Mono.Data.Tds.TdsMetaParameter.GetMetaType () <0x3c74a90 + 0x0057b> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.WriteParameterInfo (Mono.Data.Tds.TdsMetaParameter param) <0x3c72dd0 + 0x000a3> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.WriteRpcParameterInfo (Mono.Data.Tds.TdsMetaParameterCollection parameters) <0x3c72b28 + 0x00177> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.ExecRPC (System.String rpcName, Mono.Data.Tds.TdsMetaParameterCollection parameters, Int32 timeout, Boolean wantResults) <0x3c729a0 + 0x00083> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.ExecProc (System.String commandText, Mono.Data.Tds.TdsMetaParameterCollection parameters, Int32 timeout, Boolean wantResults) <0x3c72940 + 0x00052> in <filename unknown>:0
  at System.Data.SqlClient.SqlCommand.Execute (Boolean wantResults) <0x3c71ee8 + 0x0045b> in <filename unknown>:0
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery () <0x3c71898 + 0x00047> in <filename unknown>:0
  at TestMono.Console.Buyer.Save () <0x3c0d1c0 + 0x001df> in <filename unknown>:0
  at TestMono.Console.Program.Main () <0x3bd0f58 + 0x00103> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Unknown Type : timestamp
  at Mono.Data.Tds.TdsMetaParameter.GetMetaType () <0x3c74a90 + 0x0057b> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.WriteParameterInfo (Mono.Data.Tds.TdsMetaParameter param) <0x3c72dd0 + 0x000a3> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.WriteRpcParameterInfo (Mono.Data.Tds.TdsMetaParameterCollection parameters) <0x3c72b28 + 0x00177> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.ExecRPC (System.String rpcName, Mono.Data.Tds.TdsMetaParameterCollection parameters, Int32 timeout, Boolean wantResults) <0x3c729a0 + 0x00083> in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70.ExecProc (System.String commandText, Mono.Data.Tds.TdsMetaParameterCollection parameters, Int32 timeout, Boolean wantResults) <0x3c72940 + 0x00052> in <filename unknown>:0
  at System.Data.SqlClient.SqlCommand.Execute (Boolean wantResults) <0x3c71ee8 + 0x0045b> in <filename unknown>:0
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery () <0x3c71898 + 0x00047> in <filename unknown>:0
  at TestMono.Console.Buyer.Save () <0x3c0d1c0 + 0x001df> in <filename unknown>:0
  at TestMono.Console.Program.Main () <0x3bd0f58 + 0x00103> in <filename unknown>:0
Comment 1 Tiago Freitas Leal 2016-08-06 17:28:19 UTC
Tested on Mono 4.4.2.11 (Aug 02 2016)
Comment 2 Tiago Freitas Leal 2016-08-06 17:30:28 UTC
Created attachment 16930 [details]
Stored Procedure
Comment 3 Marek Safar 2018-02-22 22:22:02 UTC
Mono 5.10 has significantly improved System.Data implementation which should resolve this issue. If you can still reproduce it please reopen the issue.