-
Notifications
You must be signed in to change notification settings - Fork 260
Translate bytea.Any() as length > 0
#3817
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
Changes from 3 commits
8b793ef
403572f
f9b705e
e995de3
05db0b8
eaf214f
e2ad4b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -679,6 +679,19 @@ WHERE cardinality(s."IntArray") = 2 | |
| """); | ||
| } | ||
|
|
||
| [ConditionalFact] | ||
| public virtual async Task Bytea_Length_greater_than_zero() | ||
| { | ||
| await AssertQuery(ss => ss.Set<ArrayEntity>().Where(e => e.Bytea.Length > 0)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this test for Also, can you please move this test to ByteArrayTranslationsNpgsqlTest? The latter is then newer place for this kind of test (ArrayArrayQueryTest should eventually disappear).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I'm slightly confused, as #3816 talks about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What caused the regression is that .Length > 0 was translated similar to .Length == 7 until incl. EF8, but as far as I understand it, EF started to rewrite .Length > 0 to .Any internally from EF 9. Thus, to effectively fix .Length > 0, this PR implements .Any. Options include:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably dotnet/efcore#33644 introduced this |
||
|
|
||
| AssertSql( | ||
| """ | ||
| SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" | ||
| FROM "SomeEntities" AS s | ||
| WHERE octet_length(s."Bytea") > 0 | ||
| """); | ||
| } | ||
|
roji marked this conversation as resolved.
Outdated
|
||
|
|
||
| #endregion Length/Count | ||
|
|
||
| #region Any/All | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.