Error could not determine data type of parameter $1

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
klimaxx
Posts: 2
Joined: Sun 21 Feb 2016 03:47

Error could not determine data type of parameter $1

Post by 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/EntityFr ... micFilters).

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by 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.

klimaxx
Posts: 2
Joined: Sun 21 Feb 2016 03:47

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

Post by klimaxx » Tue 23 Feb 2016 14:06

Hi

Thanks for reply.
I confirm only 2 mentioned tests are failing with dotConnect.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by 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
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by 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.

Post Reply