-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
add case for enum return types in multi-branch case statement #2766
Conversation
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.
Looks good for fixing the issue within a case
statement. Just a couple suggestions around adding some comments to help future code readers understand why the code is special cased here.
}, | ||
}, | ||
{ | ||
Skip: true, |
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.
I think it's generally useful to add some context if we're skipping a test. Could be what's missing to make the test pass or anything else that could be useful to someone looking at this brand new next year and trying to figure out why the test is skipped.
}, | ||
Assertions: []ScriptTestAssertion{ | ||
{ | ||
Skip: true, |
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.
e.g. it might be helpful to add a comment linking to the GitHub issue for these skipped tests. That would help provide more context for a future code reader.
@@ -52,6 +52,12 @@ func combinedCaseBranchType(left, right sql.Type) sql.Type { | |||
if right == types.Null { | |||
return left | |||
} | |||
if types.IsEnum(left) && types.IsEnum(right) { |
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.
Probably worth adding a comment to explain what we're doing here. This seems pretty difficult to reverse engineer and figure out in a year or two when someone new looks at this code and tries to figure out why these cases are in here.
Hotfix for Enum conversion issue:
dolthub/dolt#8598
Doesn't address real issue, which revolves around conversion for
CASE
.