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

fixes handling of null set values #1564

Merged
merged 2 commits into from
Jan 27, 2023
Merged

fixes handling of null set values #1564

merged 2 commits into from
Jan 27, 2023

Conversation

stephkyou
Copy link
Contributor

Null set values were being ignored completely. This PR fixes this issue and addresses the display issue which shows an extra comma when null set values are present in multi-member set values.

fixes: dolthub/dolt#4966

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.

Beautiful change! Great work! 🙌

tests := []struct {
vals []string
collation sql.CollationID
val string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the val field is never used and could be removed.

@@ -172,6 +172,7 @@ func TestSetConvert(t *testing.T) {
{[]string{"one", "two"}, sql.Collation_utf8mb4_general_ci, "ONE", "one", false},
{[]string{"ONE", "two"}, sql.Collation_utf8mb4_general_ci, "one", "ONE", false},

{[]string{"one", "two"}, sql.Collation_Default, ",one,two", nil, true},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to add one more test entry for a non-error condition for a set that does allow the empty string (just because I noticed there's no coverage for that in these tests yet)

@stephkyou stephkyou merged commit 91f8055 into main Jan 27, 2023
@stephkyou stephkyou deleted the steph/dolt-4966 branch January 27, 2023 22:12
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.

Set values containing '' are not displayed correctly
2 participants