-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
parse: fix the type of date/time parameters #48237
Conversation
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Skipping CI for Draft Pull Request. |
Skipping CI for Draft Pull Request. |
@@ -0,0 +1,275 @@ | |||
// Copyright 2023 PingCAP, Inc. |
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.
Most of this file is copied from /pkg/internal/parse
. Because it's not expected to be "internal" inside the server
.
return | ||
} | ||
|
||
func TestParseExecArgs(t *testing.T) { |
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.
These tests are also moved from internal/parse/parse_test.go
.
c412eb3
to
390feae
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #48237 +/- ##
================================================
+ Coverage 71.5384% 72.8384% +1.2999%
================================================
Files 1402 1427 +25
Lines 406159 414649 +8490
================================================
+ Hits 290560 302024 +11464
+ Misses 95775 93671 -2104
+ Partials 19824 18954 -870
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f883f2c
to
449ce9a
Compare
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
/retest |
/retest |
LGTM, but is it possible to add some intergartion tests? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lcwangchao, xhebox The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Good. Added some in the latest commit 😄 |
@YangKeao: The following test failed, say
Full PR test history. Your PR dashboard. Instructions 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/test-infra repository. I understand the commands that are listed here. |
/retest |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #45190
Problem Summary:
What is changed and how it works?
Refractor the
stmtctx
inparse
to betypes.Context
.Construct the date and time from string.
I didn't construct the
Datetime
andDuration
directly from the binary, because developing a binary version ofParseXXX
can be a little complicated (especially for handling warnings/errors). To be simple and compatible with old versions, I re-use the string from old version and parse from it.Refractor the function of parsing parameters into two parts: one for splitting binary protocols into multiple parameters, one for parsing the binary parameters into expressions. The second one needs to run after when the
stmtctx
is reset, so they need to be split. It also solves some historical problem, as I also sawHandleTruncate
s besides thedate/time
part.Check List
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.