Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion enginetest/queries/script_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -9764,6 +9764,8 @@ where
},
},
{
// this is failing due to a type coercion bug in comparison.Compare
// https://github.com/dolthub/dolt/issues/9510
Skip: true,
Query: "select i, s + 0, s from t where s = '';",
Expected: []sql.Row{
Expand All @@ -9773,7 +9775,6 @@ where
},
},
{
Skip: true,
Query: "select i, s + 0, s from tt;",
Expected: []sql.Row{
{0, float64(3), "something,"},
Expand Down
6 changes: 2 additions & 4 deletions sql/types/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,6 @@ func (t SetType) convertBitFieldToString(bitField uint64) (string, error) {
if !ok {
return "", sql.ErrInvalidSetValue.New(bitField)
}
if len(val) == 0 {
continue
}
if writeCommas {
strBuilder.WriteByte(',')
} else {
Expand All @@ -367,6 +364,7 @@ func (t SetType) convertStringToBitField(str string) (uint64, error) {
return 0, nil
}
var bitField uint64
_, allowEmptyString := t.valToBit[""]
lastI := 0
var val string
for i := 0; i < len(str)+1; i++ {
Expand All @@ -375,7 +373,7 @@ func (t SetType) convertStringToBitField(str string) (uint64, error) {
}

// empty string should hash to 0, so just skip
if lastI == i {
if lastI == i && !allowEmptyString {
lastI = i + 1
continue
}
Expand Down
2 changes: 1 addition & 1 deletion sql/types/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func TestSetConvertToString(t *testing.T) {
bit uint64
expectedStr string
}{
{[]string{"", "a", "b", "c"}, sql.Collation_Default, 15, "a,b,c"},
{[]string{"", "a", "b", "c"}, sql.Collation_Default, 15, ",a,b,c"},
{[]string{"", "a", "b", "c"}, sql.Collation_Default, 14, "a,b,c"},
}

Expand Down
Loading