-
Notifications
You must be signed in to change notification settings - Fork 936
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
NH-3787 - Decimal truncation in Linq ternary expression #707
NH-3787 - Decimal truncation in Linq ternary expression #707
Conversation
I shouldn't had a look in this. Now I have added a fix commit. The trouble is due to a hack in Since I have not found any easy way to transmit the type to the hql |
1a89b1e
to
2208094
Compare
@@ -540,7 +540,7 @@ protected HqlTreeNode VisitConditionalExpression(ConditionalExpression expressio | |||
|
|||
return (expression.Type == typeof (bool) || expression.Type == (typeof (bool?))) | |||
? @case | |||
: _hqlTreeBuilder.Cast(@case, expression.Type); | |||
: _hqlTreeBuilder.TransparentCast(@case, expression.Type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a crutch, but at least one that causes less bugs.
I wonder if some other cast introduced by other methods in this file should be switched to transparent too or not. Maybe the Avg
by example, for it output cast (input casts should clearly stay actual casts). Or the Sum
cast.
2208094
to
408534f
Compare
b658019
to
d61fbb7
Compare
d61fbb7
to
8201004
Compare
Rebased and finalized. This issue looks like #708 and #709, but this yet another case. Linq expression translated to a This PR avoids this additional |
d3c32d0
to
711a39c
Compare
And SQLite cannot perform the NH-3787 test with so many digits (it does not have a true decimal type anyway). To be squashed
711a39c
to
b82fbf4
Compare
This thing is good to go in my opinion. This should be the last fix of the "decimal fix" series. |
@fredericDelaporte need to rename the PR as it is not just "tests" anymore. |
Test and fix #1335 (NH-3787)
, with the one still failing set as ignored.I will not work on that linq casting trouble soon, so better merge the tests alone.