Untyped NULL constant value is not supported for CASE statement

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Eric_08
Posts: 19
Joined: Wed 11 Jul 2018 21:50

Untyped NULL constant value is not supported for CASE statement

Post by Eric_08 » Thu 23 Jan 2020 20:23

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.

Eric_08
Posts: 19
Joined: Wed 11 Jul 2018 21:50

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

Post by Eric_08 » Mon 27 Jan 2020 14:09

Any update?

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

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

Post by Shalex » Tue 28 Jan 2020 12:09

We have reproduced the issue and will notify you when it is fixed.

Eric_08
Posts: 19
Joined: Wed 11 Jul 2018 21:50

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

Post by Eric_08 » Wed 29 Jan 2020 14:16

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

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

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

Post by Shalex » Fri 31 Jan 2020 16:37

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.

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

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

Post by Shalex » Thu 06 Feb 2020 11:07

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.

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

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

Post by Shalex » Mon 02 Mar 2020 16:24

dotConnect for Oracle v9.11.951 is released: viewtopic.php?f=1&t=39884.

Post Reply