-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
binary literal containing invalid-unicode characters are truncated in the metadata #23865
Comments
There's also another interesting thing. |
/assign |
Root cause:
Refer to https://pkg.go.dev/encoding/json#InvalidUTF8Error, https://github.com/pingcap/parser/blob/master/parser.y#L11373-L11382. Since we are storing and process binaryLiterals by the I would recommend storing and processing binaryLiterals as pure |
@xhebox |
No. For this issue, it is just a problem of storing non-UTF-8 data in the json, or in the (de)serialization process. Though we could refine the logic about To avoid invalid characters, either we use another json library that does not validate utf-8, use Except using another json library, other two changes lead to a different metadata format, different from the data persisted in TiKV... That means, break all old enum/set columns, or at least break all old enum types containing In short, to fix the problem, we may need to break more things, or use another json library, or handle the old/invalid data by some sorts of migration. EDIT: Maybe, we could somehow make use of the version field in the metadata to enable a compatible solution. I guess that needs a new proposal. |
The behavior is different from MySQL 5.7, and MySQL 8.0.. So could we treat is as a compatibility problem, not a bug? MySQL 8.0.22:
MySQL 5.7.32:
|
@wshwsh12 Does
|
In mysql5.7: @xhebox
|
Then it is a bug. TiDB doesn't work as mysql 5.7... Maybe we could add the bug label, but not the major label. It is not easy to fix anyway, @wshwsh12 .
|
I don't think this is a bug that is worth fixing since the case is barely used. |
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Two rows of value
0x00A4EEF4FA55D6706ED5
.And the select can select the rows.
3. What did you see instead (Required)
The first insert raised an error
Data Truncated
. Only one row inserted.And the select returns no row.
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: