{"action":"created","issue":{"url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/12","repository_url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries","labels_url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/12/comments","events_url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/12/events","html_url":"https://github.com/LinqToDB4iSeries/Linq2DB4iSeries/pull/12","id":327708690,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNDM1ODA5","number":12,"title":"Fix for Date and Time column predicates","user":{"login":"nsarris","id":11741762,"node_id":"MDQ6VXNlcjExNzQxNzYy","avatar_url":"https://avatars3.githubusercontent.com/u/11741762?v=4","gravatar_id":"","url":"https://api.github.com/users/nsarris","html_url":"https://github.com/nsarris","followers_url":"https://api.github.com/users/nsarris/followers","following_url":"https://api.github.com/users/nsarris/following{/other_user}","gists_url":"https://api.github.com/users/nsarris/gists{/gist_id}","starred_url":"https://api.github.com/users/nsarris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsarris/subscriptions","organizations_url":"https://api.github.com/users/nsarris/orgs","repos_url":"https://api.github.com/users/nsarris/repos","events_url":"https://api.github.com/users/nsarris/events{/privacy}","received_events_url":"https://api.github.com/users/nsarris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-30T12:29:17Z","updated_at":"2018-05-31T14:08:13Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/pulls/12","html_url":"https://github.com/LinqToDB4iSeries/Linq2DB4iSeries/pull/12","diff_url":"https://github.com/LinqToDB4iSeries/Linq2DB4iSeries/pull/12.diff","patch_url":"https://github.com/LinqToDB4iSeries/Linq2DB4iSeries/pull/12.patch"},"body":"This patch fixes the \"A conversion error has occured\" thrown by IBM.Data.DB2.iSeries when trying to execute a query with a predicate on a Date or Time column. In the current implementation the datetype for the parameter is set to DataType.DateTime which creates an iDb2DateTime parameter instead of iDb2Date or iDB2Time respectively.\r\n\r\nThe patch checks of the predicate is an operation between a field and a datetime value (or an expression of a single field and a datetime value - this happens on projections). If the check is true the sql field data type is checked and the value time is changed accordingly"},"comment":{"url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/comments/393542225","html_url":"https://github.com/LinqToDB4iSeries/Linq2DB4iSeries/pull/12#issuecomment-393542225","issue_url":"https://api.github.com/repos/LinqToDB4iSeries/Linq2DB4iSeries/issues/12","id":393542225,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzU0MjIyNQ==","user":{"login":"nsarris","id":11741762,"node_id":"MDQ6VXNlcjExNzQxNzYy","avatar_url":"https://avatars3.githubusercontent.com/u/11741762?v=4","gravatar_id":"","url":"https://api.github.com/users/nsarris","html_url":"https://github.com/nsarris","followers_url":"https://api.github.com/users/nsarris/followers","following_url":"https://api.github.com/users/nsarris/following{/other_user}","gists_url":"https://api.github.com/users/nsarris/gists{/gist_id}","starred_url":"https://api.github.com/users/nsarris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsarris/subscriptions","organizations_url":"https://api.github.com/users/nsarris/orgs","repos_url":"https://api.github.com/users/nsarris/repos","events_url":"https://api.github.com/users/nsarris/events{/privacy}","received_events_url":"https://api.github.com/users/nsarris/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T14:08:13Z","updated_at":"2018-05-31T14:08:13Z","author_association":"NONE","body":"```csharp\r\n[Table(Name = \"ICERSLPF\", Schema = \"XCRS\")]\r\n\tpublic partial class SelectedCustomer\r\n\t{\r\n\t\t[Column(IsPrimaryKey = true, Name = \"ACTNUSR\", DataType = DataType.Char, CanBeNull = false, Length = 10)]\r\n\t\tpublic string UserOfAction { get; set; }\r\n\t\t[Column(IsPrimaryKey = true, Name = \"SELDATE\", DataType = DataType.Date, CanBeNull = false)]\r\n\t\tpublic DateTime SelectionDate { get; set; }\r\n\t\t[Column(IsPrimaryKey = true, Name = \"SELTIME\", DataType = DataType.Time, CanBeNull = false)]\r\n\t\tpublic DateTime SelectionTime { get; set; }\r\n\t\t[Column(Name = \"IPIDCRA\", DataType = DataType.Decimal, CanBeNull = false, Precision = 8, Scale = 0)]\r\n\t\tpublic int IpId { get; set; }\r\n\t}\r\n```\r\n\r\nTry to update a record on this table. It has both date and time columns on its key so it breaks\r\n\r\nAlso try to place a predicate on a projection:\r\n\r\n```csharp\r\ncon.Table<SelectedCustomer>()\r\n.Select(x => new {\r\nId = IpId,\r\nDate = SelectionDate,\r\nTime = SelectionTime\r\n})\r\n.Where(x => x.Date == someDate && x.Time == someTime)\r\n.ToList()\r\n```\r\n\r\nBare in mind that on the i Series for Date to work you need a date with 0 as time and for time to work you need a DateTime with 1-1-1 for date.\r\n"}}
{"actor":{"display_login":"nsarris"}}