Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: nil (#11917)

p0nycc26aef54ea4
diff --git a/backend/plugin/advisor/mysql/advisor_online_migration.go b/backend/plugin/advisor/mysql/advisor_online_migration.go
index 63f4bb47e9..d5b19e98d5 100644
--- a/backend/plugin/advisor/mysql/advisor_online_migration.go
+++ b/backend/plugin/advisor/mysql/advisor_online_migration.go
@@ -70,7 +70,10 @@ func (*OnlineMigrationAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.A
dbSchema := model.NewDBSchema(ctx.DBSchema, nil, nil)
for _, resource := range checker.changedResources {
- tableRows := dbSchema.GetDatabaseMetadata().GetSchema(resource.Schema).GetTable(resource.Table).GetRowCount()
+ var tableRows int64
+ if table := dbSchema.GetDatabaseMetadata().GetSchema(resource.Schema).GetTable(resource.Table); table != nil {
+ tableRows = table.GetRowCount()
+ }
if tableRows >= minRows {
checker.adviceList = append(checker.adviceList, advisor.Advice{
Status: checker.level,