Page 1 of 1

Error could not determine data type of parameter $1

Posted: Sun 21 Feb 2016 04:11
by klimaxx
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.

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

Posted: Tue 23 Feb 2016 05:52
by Shalex
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.

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

Posted: Tue 23 Feb 2016 14:06
by klimaxx
Hi

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

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

Posted: Tue 23 Feb 2016 16:22
by Shalex
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.

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

Posted: Thu 25 Feb 2016 16:57
by Shalex
The new build of dotConnect for PostgreSQL 7.4.602 is available for download: http://forums.devart.com/viewtopic.php?f=3&t=33271.