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

inconsistent result for built in function uuid_to_bin #30324

Closed
unconsolable opened this issue Dec 1, 2021 · 3 comments
Closed

inconsistent result for built in function uuid_to_bin #30324

unconsolable opened this issue Dec 1, 2021 · 3 comments
Labels
type/bug This issue is a bug.

Comments

@unconsolable
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

select uuid_to_bin('urn:uuid:99a9ad03-5298-11ec-8f5c-00ff90147ac3');
select uuid_to_bin(' 99a9ad03-5298-11ec-8f5c-00ff90147ac3 ');

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

MySQL 8.0.27

mysql> select uuid_to_bin('urn:uuid:99a9ad03-5298-11ec-8f5c-00ff90147ac3');
ERROR 1411 (HY000): Incorrect string value: 'urn:uuid:99a9ad03-5298-11ec-8f5c-00ff90147ac3' for function uuid_to_bin
mysql> select uuid_to_bin(' 99a9ad03-5298-11ec-8f5c-00ff90147ac3 ');
ERROR 1411 (HY000): Incorrect string value: ' 99a9ad03-5298-11ec-8f5c-00ff90147ac3 ' for function uuid_to_bin

3. What did you see instead (Required)

mysql> select uuid_to_bin('urn:uuid:99a9ad03-5298-11ec-8f5c-00ff90147ac3');
0x99A9AD03529811EC8F5C00FF90147AC3

mysql> select uuid_to_bin(' 99a9ad03-5298-11ec-8f5c-00ff90147ac3 ');
0x99A9AD03529811EC8F5C00FF90147AC3

4. What is your TiDB version? (Required)

Release Version: v5.3.0
Edition: Community
Git Commit Hash: 4a1b2e9
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-24 13:32:39
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@unconsolable unconsolable added the type/bug This issue is a bug. label Dec 1, 2021
@unconsolable
Copy link
Contributor Author

unconsolable commented Dec 1, 2021

I think it is related to upstream package github.com/google/uuid and it's way of Parse, there are tracking issues google/uuid#60 and google/uuid#61, but haven't been merged after a year.
IMHO to fix it, a wrapper of Parse may be needed.

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants