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

ddl refactor: wanna set getPrimaryKey() public for TiCDC to resue it #35511

Closed
crelax opened this issue Jun 20, 2022 · 1 comment · Fixed by #35512
Closed

ddl refactor: wanna set getPrimaryKey() public for TiCDC to resue it #35511

crelax opened this issue Jun 20, 2022 · 1 comment · Fixed by #35512
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@crelax
Copy link
Contributor

crelax commented Jun 20, 2022

Enhancement

The function getPrimaryKey() in tidb/ddl is very similar with one function in TiCDC

tidb/ddl/ddl_api.go

Lines 1638 to 1644 in 4ae78cd

// getPrimaryKey extract the primary key in a table and return `IndexInfo`
// The returned primary key could be explicit or implicit.
// If there is no explicit primary key in table,
// the first UNIQUE INDEX on NOT NULL columns will be the implicit primary key.
// For more information about implicit primary key, see
// https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html
func getPrimaryKey(tblInfo *model.TableInfo) *model.IndexInfo {

related issue in TiFlow: pingcap/tiflow#5902

@crelax crelax added the type/enhancement The issue or PR belongs to an enhancement. label Jun 20, 2022
@crelax
Copy link
Contributor Author

crelax commented Jun 20, 2022

/assign @crelax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant