-
Notifications
You must be signed in to change notification settings - Fork 6.1k
expression: support newer UUID types #65007
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
Conversation
|
Skipping CI for Draft Pull Request. |
|
Hi @dveeden. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65007 +/- ##
================================================
- Coverage 70.8020% 68.6478% -2.1543%
================================================
Files 1901 1879 -22
Lines 518502 510526 -7976
================================================
- Hits 367110 350465 -16645
- Misses 126860 137703 +10843
+ Partials 24532 22358 -2174
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
1 similar comment
|
/retest |
|
/retest |
|
Reminder: we need to also update the doc of supported functions. https://docs.pingcap.com/tidb/stable/miscellaneous-functions/#supported-functions |
Yes, I've removed v3, v5 and v6 in 0ff52f2
Yes, that's on my todo list. We also need to update https://docs.pingcap.com/tidb/stable/uuid/ |
|
/retest |
|
/retest |
| _ functionClass = &uuidFunctionClass{} | ||
| _ functionClass = &uuidv4FunctionClass{} | ||
| _ functionClass = &uuidv7FunctionClass{} | ||
| _ functionClass = &uuidVersionFunctionClass{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't there a line for uuid_timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should have been. I've added one and checked for more missing lines and I found a few.
diff <(grep -E '^type.*FunctionClass' pkg/expression/builtin_miscellaneous.go | sort | cut -d\ -f2) <(grep -E '_ functionClass = .*FunctionClass' pkg/expression/builtin_miscellaneous.go | sort | cut -d\& -f2 | cut -d{ -f1)
diff <(grep -E '^type.*builtin' pkg/expression/builtin_miscellaneous.go | sort | cut -d\ -f2) <(grep -E '_ builtinFunc = ' pkg/expression/builtin_miscellaneous.go | sort | cut -d\& -f2 | cut -d{ -f1)The ones that were missing:
tidbRowChecksumFunctionClassbuiltinFreeLockSigbuiltinNameConstVectorFloat32SigbuiltinUsedLockSigbuiltinUUIDTimestampSigbuiltinUUIDv4SigbuiltinUUIDv7SigbuiltinUUIDVersionSigbuiltinVectorFloat32AnyValueSig
I also sorted them.
The result: 35202db
Are these lines (still) needed? What happens if they are missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these lines might be there to ensure these types implement functionClass etc.
However this seems to already be enforced by the reference in pkg/expression/builtin.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could:
- Remove these 919 lines: dveeden@af0efdb
- Add GitHub action that runs checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably keep them and add extra github action in followup PRs. Thanks for the update!
|
/retest |
|
/approve for the parser part |
|
/hold just to avoid accidentally merged, as I am not sure whether @zanmato1984 has finished review, you can unhold youself after fixing comments from him @dveeden |
zanmato1984
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, GMHDBJD, windtalker, zanmato1984 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
|
/retest |
1 similar comment
|
/retest |
|
What problem does this PR solve?
Issue Number: close #61982
Problem Summary:
What changed and how does it work?
This adds:
What this does not (yet) do is:
In other databases:
Also interesting / related:
Note that there doesn't seem to be a good standard for the function names.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
TODO
UUID_TO_BIN()andBIN_TO_UUID()actually make sense for UUID version 3-7. I assume that MySQL accepts any UUID (including those generated outside of MySQL).