Skip to content

Set values containing '' are not displayed correctly #4966

@fulghum

Description

@fulghum

MySQL allows all set types to set their value to ''. Additionally, set types may declare that '' is a valid set value and it is then allowed to be combined with any other set values. To match MySQL's output, the explicitly included '' value should not be included in the string representation of the value, but Dolt/GMS is currently displaying it.

Repro:

create table z (pk int primary key, s1 set('','a','b','c'));
insert into z values (1, ",a,b,c"), (2, "a,b,c");
select pk, s1, cast(s1 as unsigned) from z;

With MySQL, this produces:

mysql> select pk, s1, cast(s1 as unsigned) from z;
+----+-------+----------------------+
| pk | s1    | cast(s1 as unsigned) |
+----+-------+----------------------+
|  1 | a,b,c |                   15 |
|  2 | a,b,c |                   14 |
+----+-------+----------------------+

With Dolt, it produces:

fri> select pk, s1, cast(s1 as unsigned) from z;
+----+--------+----------------------+
| pk | s1     | cast(s1 as unsigned) |
+----+--------+----------------------+
| 1  | ,a,b,c | 15                   |
| 2  | a,b,c  | 14                   |
+----+--------+----------------------+

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersgood reproEasily reproducible bugssqlIssue with SQL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions