Error could not determine data type of parameter $1

Error could not determine data type of parameter $1

Postby klimaxx » Sun 21 Feb 2016 04:11

Hi

I am trying to implement db context global filtering using EntityFramework.DynamicFilters (https://www.nuget.org/packages/EntityFramework.DynamicFilters).

I am using EF6, Postgre 9.4 and dotConnect 7.4.592.

Unfortunatelly i got an error in case of using nullable filter - could not determine data type of parameter $1.
Running the failing case with npgsql driver succeeds.

SELECT
"Extent1"."Id",
"Extent1"."SimpleName",
"Extent1"."TenantId"
FROM dbo."EntityAs" AS "Extent1"
WHERE (((("Extent1"."TenantId" IS NULL) AND (:DynamicFilterParam_1 IS NULL)) OR (("Extent1"."TenantId" IS NOT NULL) AND ("Extent1"."TenantId" = :DynamicFilterParam_1))) OR (CAST(:DynamicFilterParam_2 AS boolean) IS NOT NULL)) AND ("Extent1"."SimpleName" = 'a')


-- DynamicFilterParam_1: 'null' (Type = Int32, IsNullable = false)

-- DynamicFilterParam_2: 'null' (Type = Boolean, IsNullable = false)

-- Executing at 20.2.2016 21:50:37 +01:00

Prepare: SELECT
"Extent1"."Id",
"Extent1"."SimpleName",
"Extent1"."TenantId"
FROM dbo."EntityAs" AS "Extent1"
WHERE (((("Extent1"."TenantId" IS NULL) AND ($1 IS NULL)) OR (("Extent1"."TenantId" IS NOT NULL) AND ("Extent1"."TenantId" = $1))) OR (CAST($2 AS boolean) IS NOT NULL)) AND ("Extent1"."SimpleName" = 'a')
could not determine data type of parameter $1
-- Failed in 71 ms with error: could not determine data type of parameter $1


I am attaching simple project where the situation can be replayed.
http://www.uschovna.cz/zasilka/HMWEI5RI9GSR4R2F-UH7/

To run the project please modify connection string, create postgre db, create schema dbo and run Update-Database migration command and run unit tests.
klimaxx
 
Posts: 2
Joined: Sun 21 Feb 2016 03:47

Re: Error could not determine data type of parameter $1

Postby Shalex » Tue 23 Feb 2016 05:52

Thank you for the test project. We will investigate the issue and notify you about the result.

Please confirm that only two SimpleTestDevArt tests (SelectMayHaveTenant1Test and SelectMayHaveTenant2Test) fail in your environment.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Error could not determine data type of parameter $1

Postby klimaxx » Tue 23 Feb 2016 14:06

Hi

Thanks for reply.
I confirm only 2 mentioned tests are failing with dotConnect.
klimaxx
 
Posts: 2
Joined: Sun 21 Feb 2016 03:47

Re: Error could not determine data type of parameter $1

Postby Shalex » Tue 23 Feb 2016 16:22

The bug with comparing property with integer parameter in LINQ query is fixed. We will notify you when the corresponding build of dotConnect for PostgreSQL is available for download.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Error could not determine data type of parameter $1

Postby Shalex » Thu 25 Feb 2016 16:57

The new build of dotConnect for PostgreSQL 7.4.602 is available for download: http://forums.devart.com/viewtopic.php?f=3&t=33271.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL