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

EXPORT_SET result type incompatible with MySQL lead to create index failed #27296

Closed
aytrack opened this issue Aug 17, 2021 · 2 comments · Fixed by #27376
Closed

EXPORT_SET result type incompatible with MySQL lead to create index failed #27296

aytrack opened this issue Aug 17, 2021 · 2 comments · Fixed by #27376
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Aug 17, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t1(a char, b varchar(20), c char, d varchar(20));
alter table t1 add index eidx ((export_set(3, a, c, ',', 5)));

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

mysql> alter table t1 add index eidx ((export_set(3, a, c, ',', 5)));
Query OK, 0 rows affected (0.05 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> SELECT EXPORT_SET(5,'Y','N',',',4);
Field   1:  `EXPORT_SET(5,'Y','N',',',4)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  utf8mb4_general_ci (45)
Length:     508
Max_length: 7
Decimals:   31
Flags:

3. What did you see instead (Required)

mysql> alter table t1 add index eidx ((export_set(3, a, c, ',', 5)));
ERROR 1170 (42000): BLOB/TEXT column '_V$_eidx_0' used in key specification without a key length

mysql> SELECT EXPORT_SET(5,'Y','N',',',4);
Field   1:  `EXPORT_SET(5,'Y','N',',',4)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONG_BLOB
Collation:  utf8mb4_bin (46)
Length:     67108864
Max_length: 7
Decimals:   31
Flags:      NOT_NULL


4. What is your TiDB version? (Required)

| tidb_version()                                                                                                                                                                                                                                                                                                       |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0
Edition: Community
Git Commit Hash: 88f60fe1140de999c2e64ca56edffb7db7393f1e
Git Branch: heads/refs/tags/v5.2.0
UTC Build Time: 2021-08-13 15:08:56
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Aug 17, 2021
@aytrack
Copy link
Contributor Author

aytrack commented Aug 18, 2021

from_base64、repeat、substring、mid、right、left、substr has the same problem

@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/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
2 participants