Fix regression after upstream merge#482
Merged
Merged
Conversation
Remove an unused `CreateTupleDescriptor(newColumns)` call in `RecordSetHeader.Join`. After upstream PR #248 changed the return statement to use the lazy two-arg `TupleDescriptor(a, b)` constructor, the local `newTupleDescriptor` became dead code. Combined with the later move of the >1000-column guard into `LazyData` (PR #204), this dead call eagerly tripped `NotSupportedException` during translation of complex queries whose transient joined headers exceed 1000 columns, even when the materialized recordset (after column pruning) would not. Made-with: Cursor
Switch `RecordSetHeader.CreateTupleDescriptor` (used by both `Add` overloads) from `TupleDescriptor.Create` to `TupleDescriptor.CreateFromNormalized`, matching the lazy normalization pattern already used by `Select` and the upstream-optimized `Join`. The eager `Create` factory routes to the single-arg `TupleDescriptor` constructor that synchronously materializes `LazyData` and trips the >1000-column guard during query translation, even when the resulting header is transient and gets pruned before execution. This affected `IncludeProvider`-driven translations of `Contains`-based predicates over already-wide intermediate headers (e.g. `e.statusesList.Contains(e.Membership.Status)` within complex multi-Select/SelectMany/GroupJoin chains). Add `Xtensive.Orm.Tests.Core/Rse/RecordSetHeaderTest.cs` with regression tests covering both `Add` overloads, `Join`, and the preserved runtime guard via `LazyData` access. Made-with: Cursor
Auto+TVP path of SqlDml.Variant lost its TvpTypeMapping because the complex-condition branch always allocated a fresh QueryParameterBinding, discarding the TVP binding the caller had just created. Reuse the incoming binding so CommandFactory can switch to a single table-valued parameter once the collection grows past MaxNumberOfConditions. Adds regression tests covering Bulk Update Contains over 2200 ids/guids. Made-with: Cursor
…objects-net into fix-upstream-1
Restore PR #204's lazy normalize-only body. The upstream merge kept the eager switch+Configure block but routed writes through the lazy `Data` property, forcing `LazyData` materialization (and the DO_MAX_1000_COLUMNS guard) at construction time. Deferring layout to `LazyData` removes the eager 1000-column trip during query translation and obviates the `RecordSetHeader.Add` workaround. Made-with: Cursor
SergeiPavlov
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QueryTranslationExceptionfromRecordSetHeader.Joindead code.Contains.Remove an unused
CreateTupleDescriptor(newColumns)call inRecordSetHeader.Join.After upstream PR #248 changed the return statement to use the lazy two-arg
TupleDescriptor(a, b)constructor, the localnewTupleDescriptorbecame dead code. Combined with the later move of the >1000-column guard intoLazyData(PR #204), this dead call eagerly trippedNotSupportedExceptionduring translation of complex queries whose transient joined headers exceed 1000 columns, even when the materialized recordset (after column pruning) would not.Restore PR #204's lazy normalize-only body. The upstream merge kept the eager switch+Configure block but routed writes through the lazy
Dataproperty, forcingLazyDatamaterialization (and the DO_MAX_1000_COLUMNS guard) at construction time. Deferring layout toLazyDataremoves the eager 1000-column trip during query translation and obviates theRecordSetHeader.Addworkaround.Add
Xtensive.Orm.Tests.Core/Rse/RecordSetHeaderTest.cswith regression tests covering bothAddoverloads,Join, and the preserved runtime guard viaLazyDataaccess.