Skip to content

Fix bug with NullComparisonRewriter - #495

Closed
SergeiPavlov wants to merge 9 commits into
master-servicetitanfrom
NullableEnum
Closed

Fix bug with NullComparisonRewriter#495
SergeiPavlov wants to merge 9 commits into
master-servicetitanfrom
NullableEnum

Conversation

@SergeiPavlov

@SergeiPavlov SergeiPavlov commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

NullComparisonRewriter incorrectly processes nullable enum

For example following line in a materializer:
JobStatus = r.Job != null ? r.Job.Status : null
sometime assigns default(JobStatus) instead of null (when r.Job == null)

This depends on State.IsTailMethod flag which activates NullComparisonRewriter.

Adding .Tag() can change the behavior.
or
query.ToList().First() and query.First() have different behavior.

This PR turns off NullComparisonRewriter optimization until we find how to improve it

Also:

  • Add MaterializeNullableEnum test for this case.

dagreen-st and others added 3 commits July 31, 2026 15:49
The ORM's own DbCommandExecuting/Executed events only fire for
commands run through its own execution path, and there was no hook
for a connection's first genuine open or for a raw connection handed
out without a DbCommand. Code using DirectSqlAccessor, or needing the
raw connection directly, had no way to observe any of this.

Adds a DbConnectionOpened event fired on the Closed to Open
transition, an EventNotifyingDbCommand wrapper so
DirectSqlAccessor.CreateCommand() raises the same execute events ORM
commands do, and an async GetConnectionAsync with an awaitable
raw-connection-accessed hook so callers that need the connection
itself can hook in without blocking a thread.
SergeiPavlov and others added 6 commits August 5, 2026 10:31
Five workflows still built Orm.sln, which was removed by the .slnx
migration (#386), so every push to master-servicetitan has been
failing CI with MSB1009. Points all of them at Orm.slnx instead.
The gawk pattern expected a 4-part version (x.y.z.w) to find a build
number to increment, but Version.props now uses a 3-part scheme
(e.g. 7.3.24), so it silently matched nothing and left the file
unchanged. Matches through the second dot and increments the patch
component instead.
fix CI build workflows to reference Orm.slnx
@SergeiPavlov
SergeiPavlov deleted the NullableEnum branch August 5, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants