-
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
Cast operation fails when an enum is mapped as an AnsiString #2499
Conversation
This comment has been minimized.
This comment has been minimized.
d825ec0
to
c0bf3c6
Compare
This comment has been minimized.
This comment has been minimized.
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.
Failed tests on some dialects...
Checking. |
I will make the "complex" test a bit more legible and predictable. |
I was unable to run the async generator. Never happened before. So I did the asyncification manually...
|
I believe that the failing query may actually have failed before too, but it surfaced now. Will try to investigate with Firebird or SQLite. |
For the async generator, there is an issue with it depending on which Core SDK you have on your setup. There is a workaround here. |
I believe you just changed logic a bit when did conversion to use
P.S. I don't think changes you did in last commit are required and I would prefer to keep your initial version - with minimal modifications to original tests. |
Good catch! I didn't see that hidden complexity.
I mostly agree, although I think a test that checks for count=0 easily hides problems. I'll revert a bit, and probably replicate the EnumStoredAsStringType "features". |
This reverts commit b82d1e1.
I just checked generated SQL for SQLite and I think this test indeed reveals new issue (at least for SQLite dialect). I see unnecessary select
enumtests_0_.Id as col_0_0_,
enumtests_0_.Enum as col_1_0_,
case
when enumtests_0_.Enum=@p0 then 1
else 0
end as col_2_0_,
enumtests_0_.Enum as col_3_0_,
(case
when enumtests_0_.Enum = 'Unspecified' then null
else enumtests_0_.Enum
end) as col_4_0_,
enumtests_0_.Id as id1_0_,
enumtests_0_.Name as name2_0_,
enumtests_0_.Enum as enum3_0_,
enumtests_0_.Other as other4_0_,
(case
when enumtests_0_.Enum = 'Unspecified' then null
else enumtests_0_.Enum
end) as formula2_
from
EnumEntity enumtests_0_
where
cast(case
when (case
when enumtests_0_.Enum = 'Unspecified' then null
else enumtests_0_.Enum
end)=@p1 then @p2
else coalesce((case
when enumtests_0_.Enum = 'Unspecified' then null
else enumtests_0_.Enum
end), enumtests_0_.Enum)
end as INTEGER)=@p3; -- THIS CAST IS INCORRECT @maca88 Can you take a look? |
This comment has been minimized.
This comment has been minimized.
I did check it and it is indeed not related to this PR but instead to #707, where |
I think better to do it in separate PR |
5f61374
to
7062def
Compare
Quick question. What about |
I did a quick test by setting the column sql type ( With With None of the above errors are related to this PR as |
Actually these errors might be because |
Ok, checked myself. For |
Regression from #2036
Worked fine for enums mapped as String, but not if an AnsiString or FixedLength type was used.