Skip to content

Inlined VALUES parameterized collection does not preserve ordering or type mapping #36158

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

Open
roji opened this issue May 29, 2025 · 0 comments · May be fixed by #36159
Open

Inlined VALUES parameterized collection does not preserve ordering or type mapping #36158

roji opened this issue May 29, 2025 · 0 comments · May be fixed by #36159

Comments

@roji
Copy link
Member

roji commented May 29, 2025

When using a (regular, non-parameterized) inline primitive collection, we inject an _ord SQL column if ordering needs to be preserved, and wrap the first row's value in a CAST(8 AS int) to ensure that the correct store type is used by the database. However, when the same query is performed with EF.Constant - inlining a parameterized collection - these two things aren't done.

/cc @cincuranet

@roji roji added this to the 10.0.0 milestone May 29, 2025
@roji roji self-assigned this May 29, 2025
roji added a commit to roji/efcore that referenced this issue May 29, 2025
* Refactor and generalize the pruning of the VALUES _ord column,
  moving it from RelationalTypeMappingPostprocessor to SqlPruner.
* Ensure that inlined parameterized collections (EF.Constant)
  preserved ordering via _ord and specifies the type mapping.

Fixes dotnet#36158
@roji roji linked a pull request May 29, 2025 that will close this issue
roji added a commit to roji/efcore that referenced this issue May 30, 2025
* Refactor and generalize the pruning of the VALUES _ord column,
  moving it from RelationalTypeMappingPostprocessor to SqlPruner.
* Ensure that inlined parameterized collections (EF.Constant)
  preserved ordering via _ord and specifies the type mapping.

Fixes dotnet#36158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant