Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!IsNullOrWhiteSpace CLOB column bug #272

Closed
Xor-el opened this issue Jan 14, 2023 · 2 comments
Closed

!IsNullOrWhiteSpace CLOB column bug #272

Xor-el opened this issue Jan 14, 2023 · 2 comments

Comments

@Xor-el
Copy link

Xor-el commented Jan 14, 2023

executing the query below

return await _db.Books.Where(x => !string.IsNullOrWhiteSpace(x.Metadata)).ToListAsync(cancellationToken);

against a CLOB column generates the following SQL

SELECT "b"."Id", "b"."AuthorId", "b"."Metadata", "b"."Title"
FROM "Books" "b"
WHERE (("b"."Metadata" IS NOT NULL) AND (LTRIM(RTRIM("b"."Metadata")) <> ''))

which throws ORA-00932: inconsistent datatypes: expected - got CLOB when run against the database.

note that the code generated by the inverse of the LINQ query (without the ! symbol before string.IsNullOrWhiteSpace) works ok.

Repro Project

https://github.com/Xor-el/EFCore-Oracle-Buggy-Demo/tree/!IsNullOrWhiteSpace-CLOB-column-bug

Provider and version information

EF Core version: Oracle.EntityFrameworkCore 7.21.8
Database provider: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.4.3

@alexkeh
Copy link
Member

alexkeh commented Jan 18, 2023

JSON is not currently supported in the Oracle EF Core 21.8 version. Oracle is planning to add this support soon.

This issue exists as a bug because the overarching enhancement has not been added. Bug 34989781 has been filed to track this issue. The parent enhancement request is #259.

@alexkeh alexkeh added this to the ODP.NET 21.10 milestone Jan 19, 2023
@alexkeh alexkeh removed this from the ODP.NET 21.10 milestone Apr 6, 2023
@alexkeh alexkeh added this to the ODP.NET 21.12.1 milestone Dec 8, 2023
@alexkeh
Copy link
Member

alexkeh commented Dec 8, 2023

Fixed with Oracle EF Core 8

@alexkeh alexkeh closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants