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

JSON string in multi-valued index should have binary collation #46691

Closed
YangKeao opened this issue Sep 5, 2023 · 1 comment
Closed

JSON string in multi-valued index should have binary collation #46691

YangKeao opened this issue Sep 5, 2023 · 1 comment
Assignees
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

YangKeao commented Sep 5, 2023

The json string in multi-valued index is written as utf8mb4_bin collation, which is different from the declaration in design doc:

https://github.com/pingcap/tidb/pull/42207/files#diff-f38d0335e6aecbe6435597ed53275c9ab73bf34f41c996b4ff1ed6e2be7bd12fR56

For string types, the encoding result in TiDB is collation-aware, we could use binary collation for strings(in MySQL it is utf8mb4_0900_as_cs and behaves almost the same as binary).

The good news is that the GetType returns json, so it also doesn't write RestoreData and the result is still correct 🤦 .

@YangKeao
Copy link
Member Author

YangKeao commented Oct 7, 2023

Close by #46993

@YangKeao YangKeao closed this as completed Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants