Skip to content

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

chore: skip checks for large DML (#8167)

p0ny9bcb4169d255
diff --git a/backend/common/util.go b/backend/common/util.go
index 4daa81a6c3..14378bfcf7 100644
--- a/backend/common/util.go
+++ b/backend/common/util.go
@@ -26,6 +26,8 @@ const (
MaxSheetSizeForTaskCheck = 10 * 1024 * 1024
// MaxSheetSizeForRollback is the maximum size of a sheet for rollback generator to run.
MaxSheetSizeForRollback = 8 * 1024 * 1024
+ // MaxSheetSizeForPlanCheckDML is the maximum size of a sheet for plan check to check DML changes.
+ MaxSheetSizeForPlanCheckDML = 512 * 1024
// ExternalURLPlaceholder is the docs link to configure --external-url.
ExternalURLPlaceholder = "https://www.bytebase.com/docs/get-started/install/external-url"
diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.go
index b552d47412..6f5f53ce46 100644
--- a/backend/runner/plancheck/statement_advise_executor.go
+++ b/backend/runner/plancheck/statement_advise_executor.go
@@ -126,7 +126,7 @@ func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, plan
if sheet == nil {
return nil, errors.Errorf("sheet %d not found", sheetUID)
}
- if sheet.Size > common.MaxSheetSizeForTaskCheck {
+ if (sheet.Size > common.MaxSheetSizeForTaskCheck) || (config.ChangeDatabaseType == storepb.PlanCheckRunConfig_DML && sheet.Size > common.MaxSheetSizeForPlanCheckDML) {
return []*storepb.PlanCheckRunResult_Result{
{
Status: storepb.PlanCheckRunResult_Result_SUCCESS,
diff --git a/backend/runner/plancheck/statement_report_executor.go b/backend/runner/plancheck/statement_report_executor.go
index bcce968e09..c49f0193e6 100644
--- a/backend/runner/plancheck/statement_report_executor.go
+++ b/backend/runner/plancheck/statement_report_executor.go
@@ -97,7 +97,7 @@ func (e *StatementReportExecutor) runForDatabaseTarget(ctx context.Context, plan
if sheet == nil {
return nil, errors.Errorf("sheet %d not found", sheetUID)
}
- if sheet.Size > common.MaxSheetSizeForTaskCheck {
+ if (sheet.Size > common.MaxSheetSizeForTaskCheck) || (config.ChangeDatabaseType == storepb.PlanCheckRunConfig_DML && sheet.Size > common.MaxSheetSizeForPlanCheckDML) {
return []*storepb.PlanCheckRunResult_Result{
{
Status: storepb.PlanCheckRunResult_Result_SUCCESS,
diff --git a/backend/runner/plancheck/statement_type_executor.go b/backend/runner/plancheck/statement_type_executor.go
index 31f57e6d1e..807b7579a4 100644
--- a/backend/runner/plancheck/statement_type_executor.go
+++ b/backend/runner/plancheck/statement_type_executor.go
@@ -98,7 +98,7 @@ func (e *StatementTypeExecutor) runForDatabaseTarget(ctx context.Context, planCh
if sheet == nil {
return nil, errors.Errorf("sheet %d not found", sheetUID)
}
- if sheet.Size > common.MaxSheetSizeForTaskCheck {
+ if (sheet.Size > common.MaxSheetSizeForTaskCheck) || (config.ChangeDatabaseType == storepb.PlanCheckRunConfig_DML && sheet.Size > common.MaxSheetSizeForPlanCheckDML) {
return []*storepb.PlanCheckRunResult_Result{
{
Status: storepb.PlanCheckRunResult_Result_SUCCESS,