-
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
ranger: add a more common method to calc range. #3489
Changes from 16 commits
571056f
6465b5e
c4c1732
d389f03
60c1da3
85d7432
e95771f
d398c07
647e783
676d233
ef38b46
b91ae7d
29fff91
d72024f
f4408d6
3792258
cc86fa4
b4e3721
27cf603
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,16 @@ func (t *TableInfo) GetPkName() CIStr { | |
return CIStr{} | ||
} | ||
|
||
// GetPkColInfo gets the ColumnInfo of pk if exists. | ||
func (t *TableInfo) GetPkColInfo() *ColumnInfo { | ||
for _, colInfo := range t.Columns { | ||
if mysql.HasPriKeyFlag(colInfo.Flag) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about composed pk? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. composed pk currently is treated as a index. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For all the columns in a composed pk, they will have the PriKeyFlag. Will this miss lead you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TableInfo.PkIsHandle checked outside when call this method. Move it in here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the logic is right, you can keep it untouched. But please add a comment here. |
||
return colInfo | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
// IndexColumn provides index column info. | ||
type IndexColumn struct { | ||
Name CIStr `json:"name"` // Index name | ||
|
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.
The first sentence is not clear.