Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiDB support the CI_AS collation #27946

Closed
zhenjiaogao opened this issue Sep 10, 2021 · 1 comment
Closed

TiDB support the CI_AS collation #27946

zhenjiaogao opened this issue Sep 10, 2021 · 1 comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@zhenjiaogao
Copy link

zhenjiaogao commented Sep 10, 2021

Feature Request

Is your feature request related to a problem? Please describe:

In TiDB, the parameter new_collat​​​​ions_enabled_on_first_bootstrap is set to true, but the CI_AS collation is not supported:

mysql> show collation;
+--------------------+---------+------+---------+----------+---------+
| Collation          | Charset | Id   | Default | Compiled | Sortlen |
+--------------------+---------+------+---------+----------+---------+
| ascii_bin          | ascii   |   65 | Yes     | Yes      |       1 |
| binary             | binary  |   63 | Yes     | Yes      |       1 |
| latin1_bin         | latin1  |   47 | Yes     | Yes      |       1 |
| utf8_bin           | utf8    |   83 | Yes     | Yes      |       1 |
| utf8_general_ci    | utf8    |   33 |         | Yes      |       1 |
| utf8_unicode_ci    | utf8    |  192 |         | Yes      |       1 |
| utf8mb4_bin        | utf8mb4 |   46 | Yes     | Yes      |       1 |
| utf8mb4_general_ci | utf8mb4 |   45 |         | Yes      |       1 |
| utf8mb4_unicode_ci | utf8mb4 |  224 |         | Yes      |       1 |
+--------------------+---------+------+---------+----------+---------+
9 rows in set (0.00 sec)

mysql> SELECT VARIABLE_VALUE FROM mysql.tidb WHERE VARIABLE_NAME='new_collation_enabled';
+----------------+
| VARIABLE_VALUE |
+----------------+
| True           |
+----------------+
1 row in set (0.00 sec)

mysql> create database gzj_test;
Query OK, 0 rows affected (0.08 sec)

mysql> use gzj_test;
Database changed

mysql> select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v5.2.1 |
+--------------------+
1 row in set (0.00 sec)

mysql> CREATE TABLE t (id int not null, a CHAR(50) COLLATE utf8mb4_general_ci);
Query OK, 0 rows affected (0.09 sec)

mysql> insert into t value(1, 'aaaa'), (3, 'āáǎà');
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select distinct a from t;
+------+
| a    |
+------+
| aaaa |
+------+
1 row in set (0.00 sec)

mysql> select * from t where a='aaaa   ';
+----+----------+
| id | a        |
+----+----------+
|  1 | aaaa     |
|  3 | āáǎà     |
+----+----------+
2 rows in set (0.01 sec)

In MySQL 8.0.26, using utf8mb4_0900_as_ci collation:

mysql> CREATE TABLE t (id int not null, a CHAR(50) COLLATE utf8mb4_0900_as_ci);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into t value(1, 'aaaa'), (3, 'āáǎà');
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select distinct a from t;
+----------+
| a        |
+----------+
| aaaa     |
| āáǎà     |
+----------+
2 rows in set (0.00 sec)

mysql> select * from t where a='aaaa   ';
Empty set (0.02 sec)

Describe the feature you'd like:

TiDB support the CI_AS collation similar to utf8mb4_0900_as_ci in MySQL and Pad_attribute is NO PAD

mysql> SHOW COLLATION WHERE Charset = 'utf8mb4';
+----------------------------+---------+-----+---------+----------+---------+---------------+
| Collation                  | Charset | Id  | Default | Compiled | Sortlen | Pad_attribute |
+----------------------------+---------+-----+---------+----------+---------+---------------+
| utf8mb4_0900_as_ci         | utf8mb4 | 305 |         | Yes      |       0 | NO PAD        |
......................
......................

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@zhenjiaogao zhenjiaogao added the type/feature-request Categorizes issue or PR as related to a new feature. label Sep 10, 2021
@dveeden
Copy link
Contributor

dveeden commented Jul 7, 2023

Closing this as this is being tracked in #37566

@dveeden dveeden closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants