Skip to content

Bug Report: show character set returning wrong results #13564

@dbussink

Description

@dbussink

Overview of the Issue

Running show character set returns wrong results. It only returns 2 encodings with utf8 and utf8mb4, but Vitess these days supports many more character sets & collations.

Using like for filtering the results also returns the wrong results.

Reproduction Steps

mysql> show character set;
+----------+---------------------------------+---------------------+--------+
| Charset  | Description                     | Default collation   | Maxlen |
+----------+---------------------------------+---------------------+--------+
| utf8     | UTF-8 Unicode                   | utf8mb3_general_ci  |      3 |
| utf8mb4  | UTF-8 Unicode                   | utf8mb4_general_ci  |      4 |
+----------+---------------------------------+---------------------+--------+```

There's multiple issues here. We're not using the explicit utf8mb3 value yet. It also shows utf8mb4_general_ci as the default collation which is wrong for MySQL 8. We should be using collations.Default() instead for this.

mysql> show character set like 'utf%';
+---------+------------------+--------------------+--------+
| Charset | Description      | Default collation  | Maxlen |
+---------+------------------+--------------------+--------+
| utf8    | UTF-8 Unicode   | utf8mb3_general_ci  |      3 |
+---------+------------------+--------------------+--------+

This shows only the first result and not all results that match.

Binary Version

-

Operating System and Environment details

-

Log Fragments

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions