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

Array field should be passed to the columnInfo #46717

Closed
YangKeao opened this issue Sep 6, 2023 · 0 comments · Fixed by #46993
Closed

Array field should be passed to the columnInfo #46717

YangKeao opened this issue Sep 6, 2023 · 0 comments · Fixed by #46993
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

YangKeao commented Sep 6, 2023

The following sql will fail:

create table t (pk varchar(4) primary key clustered, j json, str varchar(255), value int, key idx((cast(j as char(100) array)), str));
insert into t values ("1", '["a"]', 'b', 1);
select * from t use index(idx) where "a" member of (j);

Because tikv thinks it's a normal column and try to restore the data. However, the restore data doesn't exist in the value because tidb think it's a json and don't need to restore.

A better way to fix this is to set the collation to binary. See #46691. This issue should also be fixed for backward compatibility (for existing data / indexes).

@YangKeao YangKeao added the type/bug The issue is confirmed as a bug. label Sep 6, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 7, 2023
@YangKeao YangKeao self-assigned this Sep 8, 2023
@YangKeao YangKeao removed may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
2 participants