-
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
meta: clone table info with new foreign keys default to nil (#60103) #60129
base: release-9.0-beta.1
Are you sure you want to change the base?
meta: clone table info with new foreign keys default to nil (#60103) #60129
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-9.0-beta.1 #60129 +/- ##
=======================================================
Coverage ? 73.5321%
=======================================================
Files ? 1702
Lines ? 471318
Branches ? 0
=======================================================
Hits ? 346570
Misses ? 103571
Partials ? 21177
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: River2000i The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@River2000i: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
compatible with old versions of fk_info
pkg/meta/meta.go
Outdated
for _, substr := range filterAttrs { | ||
idx = bytes.Index(json, hack.Slice(substr)) | ||
if idx == -1 { | ||
re, err := regexp.Compile(substr) |
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.
Can we compile it ahead of time?
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.
sure, for now every db compile once.
if we compile once need to update the interface, i think it is not a good idea🤔
GetAllNameToIDAndTheMustLoadedTableInfo(dbID int64) (map[string]int64, []*model.TableInfo, error)
for _, di := range schemas {
// if the ctx has been canceled, stop fetching schemas.
if err := ctx.Err(); err != nil {
return err
}
var tables []*model.TableInfo
var err error
if vardef.SchemaCacheSize.Load() > 0 && !infoschema.IsSpecialDB(di.Name.L) {
name2ID, specialTableInfos, err := m.GetAllNameToIDAndTheMustLoadedTableInfo(di.ID)
if err != nil {
return err
}
di.TableName2ID = name2ID
tables = specialTableInfos
} else {
tables, err = m.ListTables(ctx, di.ID)
if err != nil {
return err
}
}
}
…ti-chi-bot/tidb into cherry-pick-60103-to-release-9.0-beta.1
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #60103
What problem does this PR solve?
Issue Number: close #60044
Problem Summary: fix incorrect load foreign key in memory at
GetAllNameToIDAndTheMustLoadedTableInfo
bymake([]*FKInfo, len(t.ForeignKeys))
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.