Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: refine error message (#7159)
rebelicead6d271500c4
diff --git a/backend/plugin/advisor/code.go b/backend/plugin/advisor/code.goindex e07dbffa0a..6ff8a500a7 100644--- a/backend/plugin/advisor/code.go+++ b/backend/plugin/advisor/code.go@@ -81,6 +81,7 @@ const (NoDefault Code = 420ColumnIsReferencedByView Code = 421VarcharLengthExceedsLimit Code = 422+ InvalidColumnDefault Code = 423// 501 engine error code.NotInnoDBEngine Code = 501diff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.goindex f686522387..a803f7b9d7 100644--- a/backend/plugin/advisor/sql_review.go+++ b/backend/plugin/advisor/sql_review.go@@ -981,11 +981,19 @@ func convertWalkThroughErrorToAdvice(checkContext SQLReviewCheckContext, err errLine: walkThroughError.Line,Details: details,})+ case catalog.ErrorTypeInvalidColumnTypeForDefaultValue:+ res = append(res, Advice{+ Status: Error,+ Code: InvalidColumnDefault,+ Title: "Invalid column default value",+ Content: walkThroughError.Content,+ Line: walkThroughError.Line,+ })default:res = append(res, Advice{Status: Error,Code: Internal,- Title: "Failed to walk-through",+ Title: fmt.Sprintf("Failed to walk-through with code %d", walkThroughError.Type),Content: walkThroughError.Content,Line: walkThroughError.Line,})