Description
Overview of the Issue
Unexpected type ENUM error when using SELECT DISTINCT
on an enum column with a scatter query. Using GROUP BY
instead of DISTINCT
does not crash.
Reproduction Steps
vschema
{
"sharded": true,
"tables": {
"example": {
"column_vindexes": [
{
"column": "id",
"name": "hash"
}
]
}
},
"vindexes": {
"hash": {
"type": "xxhash"
}
}
}
schema
CREATE TABLE `example` (
`id` bigint unsigned NOT NULL,
`foo` enum('a', 'b') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
setup
INSERT INTO `example` (`id`, `foo`) VALUES (1, 'a'), (2, 'b');
error reproducer
SELECT DISTINCT `foo` FROM `example`;
Binary Version
vitess/vttestserver:v21.0.2-mysql80
Operating System and Environment details
vitess/vttestserver:v21.0.2-mysql80