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

executor: support range column in show create table #6332

Merged

Conversation

zhexuany
Copy link
Contributor

@zhexuany zhexuany commented Apr 21, 2018

This PR aims to support range columns partition in show create table statement.

@zhexuany
Copy link
Contributor Author

@coocood @jackysp PTAL

@jackysp
Copy link
Member

jackysp commented Apr 23, 2018

/run-all-tests

executor/show.go Outdated
multipleLt := false
for j, lessThan := range def.LessThan {
if j > 0 {
lessThans = lessThans + "," + lessThan
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use strings.Join?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the difference between strings.Join and +?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

executor/show.go Outdated
if i < len(partitionInfo.Definitions)-1 {
buf.WriteString(fmt.Sprintf(" PARTITION %s VALUES LESS THAN %s,\n", def.Name, def.LessThan[0]))
if multipleLt {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can just check it outside this if block and add () to lessThans if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

@zhexuany
Copy link
Contributor Author

@lamxTyler PTAL

@jackysp
Copy link
Member

jackysp commented Apr 25, 2018

LGTM

@zhexuany zhexuany force-pushed the support_range_column_in_show_create_table branch from ee4a3de to 8a64c58 Compare April 25, 2018 03:05
Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx
Copy link
Contributor

alivxxx commented Apr 25, 2018

/run-all-tests

@zhexuany zhexuany added status/LGT2 Indicates that a PR has LGTM 2. all-tests-passed labels Apr 25, 2018
@zhexuany zhexuany merged commit 0d0d988 into pingcap:master Apr 25, 2018
@zhexuany zhexuany deleted the support_range_column_in_show_create_table branch April 25, 2018 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants