-
Notifications
You must be signed in to change notification settings - Fork 187
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
fix: 审核插件 AuditResult 以及相关函数格式变更 #1426
Conversation
sqle/driver/mysql/mysql.go
Outdated
@@ -352,7 +352,7 @@ func (i *MysqlDriverImpl) audit(ctx context.Context, sql string) (*driverV2.Audi | |||
buf.WriteString(fmt.Sprintf(", 原因(%s)", advice.Reason)) | |||
} | |||
} | |||
i.result.Add(driverV2.RuleLevelNotice, buf.String()) | |||
i.result.Add(driverV2.RuleLevelNotice, "", buf.String()) |
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.
添加索引有相关规则对应
sqle/driver/mysql/mysql.go
Outdated
@@ -362,9 +362,9 @@ func (i *MysqlDriverImpl) audit(ctx context.Context, sql string) (*driverV2.Audi | |||
} | |||
if useGhost { | |||
if _, err := i.executeByGhost(ctx, sql, true); err != nil { | |||
i.result.Add(driverV2.RuleLevelError, fmt.Sprintf("表空间大小超过%vMB, 将使用gh-ost进行上线, 但是dry-run抛出如下错误: %v", i.cnf.DDLGhostMinSize, err)) | |||
i.result.Add(driverV2.RuleLevelError, "", fmt.Sprintf("表空间大小超过%vMB, 将使用gh-ost进行上线, 但是dry-run抛出如下错误: %v", i.cnf.DDLGhostMinSize, err)) |
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.
gh-ost 有相关规则对应
sqle/driver/mysql/mysql.go
Outdated
} else { | ||
i.result.Add(ghostRule.Level, fmt.Sprintf("表空间大小超过%vMB, 将使用gh-ost进行上线", i.cnf.DDLGhostMinSize)) | ||
i.result.Add(ghostRule.Level, "", fmt.Sprintf("表空间大小超过%vMB, 将使用gh-ost进行上线", i.cnf.DDLGhostMinSize)) |
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.
gh-ost 有相关规则对应
sqle/driver/mysql/mysql.go
Outdated
@@ -374,7 +374,7 @@ func (i *MysqlDriverImpl) audit(ctx context.Context, sql string) (*driverV2.Audi | |||
return nil, err | |||
} | |||
if oscCommandLine != "" { | |||
i.result.Add(driverV2.RuleLevelNotice, fmt.Sprintf("[osc]%s", oscCommandLine)) | |||
i.result.Add(driverV2.RuleLevelNotice, "", fmt.Sprintf("[osc]%s", oscCommandLine)) |
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.
osc 有相关规则对应
sqle/driver/mysql/audit.go
Outdated
@@ -81,7 +81,7 @@ func (i *MysqlDriverImpl) CheckExplain(node ast.Node) error { | |||
_, err = i.Ctx.GetExecutionPlan(node.Text()) | |||
} | |||
if err != nil { | |||
i.result.Add(driverV2.RuleLevelWarn, fmt.Sprintf(CheckInvalidErrorFormat, err)) | |||
i.result.Add(driverV2.RuleLevelWarn, "", fmt.Sprintf(CheckInvalidErrorFormat, err)) |
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.
预检查有对应的规则
fix:
related: #1411