Skip to content

Commit 4fa5f89

Browse files
committed
need to handle empty strings in set comparisons
1 parent 7cb7571 commit 4fa5f89

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

sql/types/set.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ func (t SetType) Compare(ctx context.Context, a interface{}, b interface{}) (int
129129
au := ai.(uint64)
130130
bu := bi.(uint64)
131131

132-
if t.isEmptyString(au) && t.isEmptyString(bu) {
133-
return 0, nil
134-
}
135132
if au < bu {
136133
return -1, nil
137134
} else if au > bu {
@@ -361,11 +358,6 @@ func (t SetType) convertBitFieldToString(bitField uint64) (string, error) {
361358
return strBuilder.String(), nil
362359
}
363360

364-
func (t SetType) isEmptyString(bitField uint64) bool {
365-
emptyStringBit, ok := t.valToBit[""]
366-
return bitField == 0 || (ok && bitField == emptyStringBit)
367-
}
368-
369361
// convertStringToBitField converts the given string into a bit field.
370362
func (t SetType) convertStringToBitField(str string) (uint64, error) {
371363
if str == "" {

0 commit comments

Comments
 (0)