Skip to content

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

chore: remove unused code (#12438)

Danny Xu7d89ceaa903d
diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.go
index c15db19418..8e72a84741 100644
--- a/backend/plugin/db/driver.go
+++ b/backend/plugin/db/driver.go
@@ -352,13 +352,9 @@ func Open(ctx context.Context, dbType storepb.Engine, driverConfig DriverConfig,
// ExecuteOptions is the options for execute.
type ExecuteOptions struct {
- CreateDatabase bool
- BeginFunc func(ctx context.Context, conn *sql.Conn) error
- EndTransactionFunc func(tx *sql.Tx) error
- // ChunkedSubmission is the flag to indicate if we should use chunked submission for the statement.
- // If true, we will submit each statement chunk, otherwise we will submit all statements in a batch.
- // For both cases, we will use one transaction to wrap the statements.
- ChunkedSubmission bool
+ CreateDatabase bool
+ BeginFunc func(ctx context.Context, conn *sql.Conn) error
+ EndTransactionFunc func(tx *sql.Tx) error
UpdateExecutionStatus func(*v1pb.TaskRun_ExecutionDetail)
CreateTaskRunLog func(time.Time, *storepb.TaskRunLog) error
}
diff --git a/backend/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.go
index 3a8824ded5..e47c3bd844 100644
--- a/backend/plugin/db/mysql/mysql.go
+++ b/backend/plugin/db/mysql/mysql.go
@@ -317,7 +317,7 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteO
var totalCommands int
var commands []base.SingleSQL
var originalIndex []int
- if opts.ChunkedSubmission && len(statement) <= common.MaxSheetCheckSize {
+ if len(statement) <= common.MaxSheetCheckSize {
singleSQLs, err := mysqlparser.SplitSQL(statement)
if err != nil {
return 0, errors.Wrapf(err, "failed to split sql")
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index 8a33ce7758..f07cab77e1 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -451,7 +451,7 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
if len(remainingSQLs) != 0 {
var totalCommands int
var chunks [][]base.SingleSQL
- if opts.ChunkedSubmission && len(statement) <= common.MaxSheetCheckSize {
+ if len(statement) <= common.MaxSheetCheckSize {
totalCommands = len(remainingSQLs)
ret, err := util.ChunkedSQLScript(remainingSQLs, common.MaxSheetChunksCount)
if err != nil {
diff --git a/backend/plugin/db/redshift/redshift.go b/backend/plugin/db/redshift/redshift.go
index bc981a9778..85450c129f 100644
--- a/backend/plugin/db/redshift/redshift.go
+++ b/backend/plugin/db/redshift/redshift.go
@@ -213,7 +213,7 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
if len(remainingSQLs) != 0 {
var totalCommands int
var chunks [][]base.SingleSQL
- if opts.ChunkedSubmission && len(statement) <= common.MaxSheetCheckSize {
+ if len(statement) <= common.MaxSheetCheckSize {
totalCommands = len(remainingSQLs)
ret, err := util.ChunkedSQLScript(remainingSQLs, common.MaxSheetChunksCount)
if err != nil {
diff --git a/backend/plugin/db/risingwave/risingwave.go b/backend/plugin/db/risingwave/risingwave.go
index 39416fa2a5..78d0e7d3c7 100644
--- a/backend/plugin/db/risingwave/risingwave.go
+++ b/backend/plugin/db/risingwave/risingwave.go
@@ -267,7 +267,7 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
if len(remainingSQLs) != 0 {
var totalCommands int
var chunks [][]base.SingleSQL
- if opts.ChunkedSubmission && len(statement) <= common.MaxSheetCheckSize {
+ if len(statement) <= common.MaxSheetCheckSize {
totalCommands = len(remainingSQLs)
ret, err := util.ChunkedSQLScript(remainingSQLs, common.MaxSheetChunksCount)
if err != nil {
diff --git a/backend/plugin/db/tidb/tidb.go b/backend/plugin/db/tidb/tidb.go
index d28731f096..daa3653b0f 100644
--- a/backend/plugin/db/tidb/tidb.go
+++ b/backend/plugin/db/tidb/tidb.go
@@ -192,7 +192,7 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
var nonTransactionStmts []string
var totalCommands int
var commands []base.SingleSQL
- if opts.ChunkedSubmission && len(statement) <= common.MaxSheetCheckSize {
+ if len(statement) <= common.MaxSheetCheckSize {
singleSQLs, err := tidbparser.SplitSQL(statement)
if err != nil {
return 0, errors.Wrapf(err, "failed to split sql")
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index 71ef37b9b7..6eb0e3b39c 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -244,7 +244,6 @@ func executeMigration(
storepb.Engine_REDSHIFT, storepb.Engine_RISINGWAVE, storepb.Engine_ORACLE,
storepb.Engine_DM, storepb.Engine_OCEANBASE_ORACLE, storepb.Engine_MSSQL,
storepb.Engine_DYNAMODB:
- opts.ChunkedSubmission = true
opts.UpdateExecutionStatus = func(detail *v1pb.TaskRun_ExecutionDetail) {
stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
state.TaskRunExecutionStatus{