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

collation and flag of some functions are wrong #23759

Closed
xiongjiwei opened this issue Mar 31, 2021 · 2 comments · Fixed by #23835
Closed

collation and flag of some functions are wrong #23759

xiongjiwei opened this issue Mar 31, 2021 · 2 comments · Fixed by #23835
Assignees
Labels
severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@xiongjiwei
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a char(10) collate utf8mb4_general_ci, b char(10) collate utf8mb4_unicode_ci);
insert into t values ('a', 'a')
select concat(a, 0x80) from t;

2. What did you expect to see? (Required)

mysql> select concat(a, 0x80) from t;
Field   1:  `concat(a, 0x80)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  utf8mb4_0900_ai_ci (255)
Length:     44
Max_length: 4
Decimals:   31
Flags:


+-----------------+
| concat(a, 0x80) |
+-----------------+
| a�               |
| 一�              |
+-----------------+
2 rows in set (0.00 sec)

3. What did you see instead (Required)

Database changed
mysql> select concat(a, 0x80) from t;
Field   1:  `concat(a, 0x80)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  binary (63)
Length:     13
Max_length: 4
Decimals:   31
Flags:      NOT_NULL BINARY


+----------------------------------+
| concat(a, 0x80)                  |
+----------------------------------+
| 0x6180                           |
| 0xE4B88080                       |
+----------------------------------+
2 rows in set (0.02 sec)

it should not be binary

4. What is your TiDB version? (Required)

@sykp241095
Copy link
Member

Hi, will it be fixed in 5.0 GA ?

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants