Skip to content

Propagate ExpectedType to CaseNode in hql #2705

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

Merged
merged 3 commits into from
Mar 20, 2021

Conversation

bahusoid
Copy link
Member

@bahusoid bahusoid commented Mar 17, 2021

Fixes #2704

The following expression x.IsChiusa == !no

In 5.2 is generated simply as alias.IsChiusa=@p0 (@p0 is set to !no)
In 5.3 is generated as alias.IsChiusa=case when not (@p0='S') then 1 else 0 end (@p0 is set to no). Where 1 and 0 are invalid values inside case statement, as IsChiusa is string column.

Not sure what causes different query (maybe #2335) but provided fix makes sure that constants inside case statement are properly translated for custom type

@bahusoid bahusoid changed the title WIP Propagate ExpectedType to CaseNode in hql Propagate ExpectedType to CaseNode in hql Mar 17, 2021
@bahusoid bahusoid linked an issue Mar 17, 2021 that may be closed by this pull request
@fredericDelaporte fredericDelaporte added this to the 5.3.7 milestone Mar 17, 2021
@maca88
Copy link
Contributor

maca88 commented Mar 18, 2021

Not sure what causes different query (maybe #2335)

That is correct, this is a regression of #2335 which prevented variables to be evaluated. Thanks for fixing the issue.

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

Successfully merging this pull request may close these issues.

IEnhancedUserType from string to bool fails in some circumstances
3 participants