Bug 24935 - Dynamic property is case sensitive
Summary: Dynamic property is case sensitive
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-11-29 13:57 UTC by eetasoft
Modified: 2015-01-13 05:24 UTC (History)
2 users (show)

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


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.