Bug 24935

Summary: Dynamic property is case sensitive
Product: [Mono] Class Libraries Reporter: eetasoft
Component: System.DataAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono
Priority: ---    
Version: 3.2.x   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description eetasoft 2014-11-29 13:57:12 UTC
dynamic property returned by webmatrix from npgsql is case sensitive.

Steps to reproduce:


1. Create ASP.NET MVC 4 application using Microsoft Webmatrix.Data.dll and Npgsql with controller:

        public ActionResult CaseTest()
        {
            using (var db = Database.OpenConnectionString(ConnectionString(),
            "Npgsql"))
            {
                var vaik = db.QuerySingle("select 'Test' as Test");
                return new ContentResult() { Content = vaik.Test };
            }
        }


        static string ConnectionString()
        {
            NpgsqlConnectionStringBuilder csb = new NpgsqlConnectionStringBuilder()
            {
                SearchPath = "public",
                Host = "localhost",
                Database = "postgres",
                UserName = "postgres",
            };
            return csb.ConnectionString;
        }

2. Invoke controller CaseTest method in linux

Observed:

[System.IndexOutOfRangeException]: Array index is out of range.
at System.Data.Common.DbDataRecordImpl.GetValue (int) <0x0005f>
at System.Data.Common.DbDataRecordImpl.get_Item (int) <0x00018>
at System.Data.Common.DbDataRecordImpl.get_Item (string) <0x00027>
at WebMatrix.Data.DynamicRecord.get_Item (string) <0x00030>
at WebMatrix.Data.DynamicRecord.TryGetMember (System.Dynamic.GetMemberBinder,object&) <0x0002b>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object) <0x000e9>
at My.Controllers.ReportController.CaseTest () <0x001d3>
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,System.Web.Mvc.ControllerBase,object[]) <0x00045>
at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase,object[]) <0x0002d>
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext,System.Collections.Generic.IDictionary`2<string, object>) <0x001ff>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00033>
at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00023>
at System.Web.Mvc.Async.AsyncControllerActionInvoker/<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41 () <0x0001f>
at System.Web.Mvc.Async.AsyncResultWrapper/<>c__DisplayClass8`1<System.Web.Mvc.ActionResult>.<BeginSynchronous>b__7 (System.IAsyncResult) <0x00019>
at System.Web.Mvc.Async.AsyncResultWrapper/WrappedAsyncResult`1<System.Web.Mvc.ActionResult>.End () <0x0005a>
at System.Web.Mvc.Async.AsyncResultWrapper.End<System.Web.Mvc.ActionResult> (System.IAsyncResult,object) <0x0003b>
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod (System.IAsyncResult) <0x00027>
at System.Web.Mvc.Async.AsyncControllerActionInvoker/<>c__DisplayClass37/<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33 () <0x0007e>
at System.Web.Mvc.Async.AsyncControllerActionInvoker/<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49 () <0x00038>


Expected:

controller shoudl return Test

In .NET 4 in Windows it produces expected result.
Comment 1 eetasoft 2014-12-01 13:54:23 UTC
Also entered in https://github.com/npgsql/npgsql/issues/421
Comment 2 Marek Safar 2015-01-13 05:24:48 UTC
It should be fixed in master