-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Missing checks for predicate when simplifying JSON primitive collections #33932
Labels
area-json
area-primitive-collections
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Milestone
Comments
roji
changed the title
SQLite: Count() over JSON collection incorrectly translated to json_array_length when a predicate exists
Missing checks for predicate when simplifying JSON primitive collections
Jun 8, 2024
roji
added a commit
to roji/efcore
that referenced
this issue
Jun 8, 2024
roji
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jun 8, 2024
roji
added a commit
to roji/efcore
that referenced
this issue
Jun 8, 2024
roji
added a commit
that referenced
this issue
Jun 9, 2024
Reopening to consider servicing (PR: #33939) |
roji
added a commit
to roji/efcore
that referenced
this issue
Jun 9, 2024
…ns (dotnet#33933) Fixes dotnet#33932 (cherry picked from commit b84707f)
roji
added a commit
to roji/efcore
that referenced
this issue
Jun 9, 2024
… simplifications (dotnet#33933) Fixes dotnet#33932 (cherry picked from commit b84707f)
AndriySvyryd
pushed a commit
that referenced
this issue
Jun 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-json
area-primitive-collections
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
In the query pipeilne, we pattern match specific LINQ operators to translate to specialized functions/operators. For example, on SQLite, the query fragment
Where(b => b.Ints.Count() == 8)
is translated tojson_array_length(b.Ints) = 8
, rather than the full subquery translation (SELECT COUNT(*) FROM json_each(b.Ints)) == 8
).Unfortunately, in many of the sites where this sort of pattern matching occurs, I left out checking the predicate. As a result, we perform these simplifications even when we shouldn't. For example,
Where(b => b.Ints.Where(i => i > 3).Count() == 8)
also translates tojson_array_length(b.Ints) = 8
, effectively ignoring the Where().Corresponding issue for PG: npgsql/efcore.pg#3195
The text was updated successfully, but these errors were encountered: