Efcore.pg: Array with length 0 transformation doesn't seem to work

Created on 20 Aug 2019  路  4Comments  路  Source: npgsql/efcore.pg

Hello,

following where condition:

...Where(x => (x.SomeArray == null || x.SomeArray.Length == 0 || x.SomeArray.Contains(someValue));

This works if x.SomeArray is null and if it contains the value, but it doesn't match anything, when the array is empty.

I checked and array_length(empty_array, 1) returns NULL in postgres. Might that be the source of the error?

Thanks for your time, have a great week!

bug

Most helpful comment

Fixed for 2.2.6 (or whichever comes next) in ce5c144bc102d0c79b5ab03df43034646412e3ed
Fixed for 2.1.11 (or whichever comes next) in 3d83488f3d440f8ac4bf0cee06ee988257119fef
Fix for 3.0 covered by #987

All 4 comments

@pgrm that definitely sounds like it could be it. Can you confirm which version you're using?

@YohDeadfall do you want this?

Hey @roji,

Answering your question, on behalf of @pgrm we are currently using Npgsql.EntityFrameworkCore.PostgreSQL version 2.2.4

Fixed for 2.2.6 (or whichever comes next) in ce5c144bc102d0c79b5ab03df43034646412e3ed
Fixed for 2.1.11 (or whichever comes next) in 3d83488f3d440f8ac4bf0cee06ee988257119fef
Fix for 3.0 covered by #987

Was this page helpful?
0 / 5 - 0 ratings

Related issues

austindrenski picture austindrenski  路  5Comments

TPucke picture TPucke  路  3Comments

aaronhudon picture aaronhudon  路  3Comments

win32nipuh picture win32nipuh  路  4Comments

roji picture roji  路  4Comments