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

*: fix ineffectual assignments and misspellings #9481

Merged
merged 12 commits into from
Feb 28, 2019
Merged

*: fix ineffectual assignments and misspellings #9481

merged 12 commits into from
Feb 28, 2019

Conversation

xiekeyi98
Copy link
Contributor

@xiekeyi98 xiekeyi98 commented Feb 27, 2019

What problem does this PR solve?

Because in the near future , I want to add more test in CI.

tidb/Makefile

Line 67 in 45f9d6a

check-fail: goword check-static check-slow

It is necessary to fix ineffassign and mis-spell.
image

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has code style changed.

Side effects

  • Possible readability regression

Related changes

  • None

@xiekeyi98
Copy link
Contributor Author

/run-all-tests

1 similar comment
@xiekeyi98
Copy link
Contributor Author

/run-all-tests

@xiekeyi98
Copy link
Contributor Author

/run-unit-test

@zz-jason zz-jason changed the title *: fix ineffassign and mis-spell *: fix ineffectual assignments and misspellings Feb 27, 2019
@zz-jason zz-jason added type/enhancement The issue or PR belongs to an enhancement. component/expression sig/execution SIG execution labels Feb 27, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 27, 2019
@zz-jason zz-jason requested review from qw4990 and winkyao February 27, 2019 05:17
@codecov-io
Copy link

codecov-io commented Feb 27, 2019

Codecov Report

Merging #9481 into master will decrease coverage by <.01%.
The diff coverage is 35.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9481      +/-   ##
==========================================
- Coverage   67.38%   67.38%   -0.01%     
==========================================
  Files         374      374              
  Lines       78647    78653       +6     
==========================================
+ Hits        52995    52997       +2     
- Misses      20893    20895       +2     
- Partials     4759     4761       +2
Impacted Files Coverage Δ
executor/joiner.go 86.19% <ø> (ø) ⬆️
structure/hash.go 69.18% <0%> (ø) ⬆️
types/time.go 61.43% <0%> (-0.18%) ⬇️
structure/list.go 70.54% <0%> (ø) ⬆️
executor/join.go 79.58% <100%> (+0.51%) ⬆️
executor/radix_hash_join.go 69.74% <100%> (+0.25%) ⬆️
expression/builtin_time.go 65.07% <100%> (+0.01%) ⬆️
util/systimemon/systime_mon.go 80% <0%> (-20%) ⬇️
store/tikv/lock_resolver.go 41.7% <0%> (-0.95%) ⬇️
expression/schema.go 93.75% <0%> (-0.79%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9259785...e6e3a49. Read the comment docs.

@zz-jason
Copy link
Member

/run-all-tests

@@ -201,7 +201,7 @@ func (e *HashJoinExec) fetchOuterChunks(ctx context.Context) {
return
}
var outerResource *outerChkResource
ok := true
var ok bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of ok is true in the original code, why change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed , it has not used at all.
Next time it is used by case outerResource, ok = <-e.outerChkResourceCh:
It has been overwritten.

@@ -5619,7 +5619,8 @@ func (b *builtinLastDaySig) evalTime(row chunk.Row) (types.Time, bool, error) {
return types.Time{}, true, handleInvalidTimeError(b.ctx, err)
}
tm := arg.Time
year, month, day := tm.Year(), tm.Month(), 30
var day int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of day is 30 in the original code, why change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time , it is used in day = types.GetLastDay(year, month)
It has been already overwritten.
I think 30 is never used.

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added the status/LGT2 Indicates that a PR has LGTM 2. label Feb 28, 2019
@zimulala zimulala removed the status/LGT1 Indicates that a PR has LGTM 1. label Feb 28, 2019
@xiekeyi98
Copy link
Contributor Author

/run-all-tests

@xiekeyi98 xiekeyi98 merged commit 2433e28 into pingcap:master Feb 28, 2019
@xiekeyi98 xiekeyi98 deleted the ineffassignAndMisspell branch February 28, 2019 11:25
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor. sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants