Page 1 of 1

Untyped NULL constant value is not supported for CASE statement

Posted: Thu 23 Jan 2020 20:23
by Eric_08
I'm getting

Code: Select all

System.NotImplementedException: Untyped NULL constant value is not supported.
error when DevArt attempts to build Oracle CASE statement in the query from the following .NET code:

Code: Select all

            var query =
                from a in some_table
                let j = (a.Column1 == "0" ? a.Column1 : null) // <-- Fails because of null value!
                select j;

            var h = await query.FirstOrDefaultAsync();

Full stack trace:

Code: Select all

System.NotImplementedException: Untyped NULL constant value is not supported.
   at Devart.Common.Entity.dc.a(SqlConstantExpression A_0)
   at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)
   at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.VisitCase(CaseExpression caseExpression)
   at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)
   at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.VisitProjection(ProjectionExpression projectionExpression)
   at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)
   at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.<VisitSelect>b__18_0(ProjectionExpression e)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.GenerateList[T](IReadOnlyList`1 items, Action`1 generationAction, Action`1 joinAction)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.VisitSelect(SelectExpression selectExpression)
   at Devart.Common.Entity.dc.c(SelectExpression A_0)
   at Devart.Data.Oracle.Entity.bg.a(SelectExpression A_0)
   at Microsoft.EntityFrameworkCore.Query.QuerySqlGenerator.GetCommand(SelectExpression selectExpression)
   at Devart.Common.Entity.dc.e(SelectExpression A_0)
   at Microsoft.EntityFrameworkCore.Query.Internal.RelationalCommandCache.GetRelationalCommand(IReadOnlyDictionary`2 parameters)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() Untyped NULL constant value is not supported.
The above error occurs when using new DevArt driver 9.10.925 with .NET Core 3.1.1/EF Core 3.1.1. However, everything works correctly when the code was running on NET Core 2.2/EF Core 2.2.6 using DevArt driver 9.9.887, so it appears that upgrading to .NET Core 3.1/EF Core 3.1 is causing this issue.

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Mon 27 Jan 2020 14:09
by Eric_08
Any update?

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Tue 28 Jan 2020 12:09
by Shalex
We have reproduced the issue and will notify you when it is fixed.

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Wed 29 Jan 2020 14:16
by Eric_08
Great. When can we expect the new DevArt build with fixes to this issue and other .NET Core 3.1/EF Core 3.1 issues? I need to upgrade my application to run .NET Core 3.1/EF Core 3.1, and due to various outstanding issues with DevArt driver, I'm unable to do so.

Thanks,
Eric

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Fri 31 Jan 2020 16:37
by Shalex
We will provide the internal build with fixes after the bug you reported is solved. We are working on it.

We plan to release the new public builds in several weeks.

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Thu 06 Feb 2020 11:07
by Shalex
The bug with using NULL constant values in EF Core 3 is fixed. We will notify you when the new public build is available for download.

Re: Untyped NULL constant value is not supported for CASE statement

Posted: Mon 02 Mar 2020 16:24
by Shalex
dotConnect for Oracle v9.11.951 is released: viewtopic.php?f=1&t=39884.