Skip to content
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

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Nov 25, 2024

Hotfix for Enum conversion issue:
dolthub/dolt#8598

Doesn't address real issue, which revolves around conversion for CASE.

Copy link
Contributor

@fulghum fulghum left a 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,
Copy link
Contributor

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,
Copy link
Contributor

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) {
Copy link
Contributor

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.

@jycor jycor merged commit 6625ccc into main Nov 25, 2024
7 checks passed
@jycor jycor deleted the james/enum branch November 25, 2024 21:09
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