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

Built-in Function: bin #2924

Merged
merged 6 commits into from
Mar 29, 2017
Merged

Built-in Function: bin #2924

merged 6 commits into from
Mar 29, 2017

Conversation

silentred
Copy link
Contributor

Also fixed three places where golint throws warning.

plan/logical_plan_builder.go:851:2: can probably use "var sortMergeTables []model.CIStr" instead
plan/physical_plan_builder.go:587:2: can probably use "var result [][]*requiredProperty" instead
plan/physical_plan_builder.go:588:2: can probably use "var condIndex []int" instead

@coocood coocood added the contribution This PR is from a community contributor. label Mar 26, 2017
}
bits := fmt.Sprintf("%b", uint64(num))
d.SetString(bits)

Copy link
Member

Choose a reason for hiding this comment

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

Remove the empty line.

if err != nil {
return d, errors.Trace(err)
}
arg := args[0]
Copy link
Member

Choose a reason for hiding this comment

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

Check if arg.IsNil()

{10, "1010"},
{10.0, "1010"},
{-1, "1111111111111111111111111111111111111111111111111111111111111111"},
{"-1", "1111111111111111111111111111111111111111111111111111111111111111"},
Copy link
Member

Choose a reason for hiding this comment

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

Add a test case for nil input.

@shenli
Copy link
Member

shenli commented Mar 27, 2017

@silentred Thanks for your PR! Please resolve the conflicts and address the comments.

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 28, 2017
Copy link
Member

@coocood coocood left a comment

Choose a reason for hiding this comment

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

LGTM

@coocood coocood merged commit 7031e28 into pingcap:master Mar 29, 2017
@coocood
Copy link
Member

coocood commented Mar 29, 2017

@silentred
Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants