Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: command text and compute diff log (#17141)
p0ny3cd84a42c72f
diff --git a/backend/plugin/db/clickhouse/clickhouse.go b/backend/plugin/db/clickhouse/clickhouse.goindex 0770abcad1..ca968d2588 100644--- a/backend/plugin/db/clickhouse/clickhouse.go+++ b/backend/plugin/db/clickhouse/clickhouse.go@@ -172,10 +172,10 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, singleSQLs []basetotalRowsAffected := int64(0)for i, singleSQL := range singleSQLs {- opts.LogCommandExecute([]int32{int32(i)})+ opts.LogCommandExecute([]int32{int32(i)}, singleSQL.Text)sqlResult, err := tx.ExecContext(ctx, singleSQL.Text)if err != nil {- opts.LogCommandResponse([]int32{int32(i)}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),Start: singleSQL.Start,@@ -187,7 +187,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, singleSQLs []base// Since we cannot differentiate DDL and DML yet, we have to ignore the error.slog.Debug("rowsAffected returns error", log.BBError(err))}- opts.LogCommandResponse([]int32{int32(i)}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")totalRowsAffected += rowsAffected}@@ -204,10 +204,10 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, singleSQLs []basefunc (d *Driver) executeInAutoCommitMode(ctx context.Context, singleSQLs []base.SingleSQL, opts db.ExecuteOptions) (int64, error) {totalRowsAffected := int64(0)for i, singleSQL := range singleSQLs {- opts.LogCommandExecute([]int32{int32(i)})+ opts.LogCommandExecute([]int32{int32(i)}, singleSQL.Text)sqlResult, err := d.db.ExecContext(ctx, singleSQL.Text)if err != nil {- opts.LogCommandResponse([]int32{int32(i)}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return totalRowsAffected, err}rowsAffected, err := sqlResult.RowsAffected()@@ -217,7 +217,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, singleSQLs []base.} else {totalRowsAffected += rowsAffected}- opts.LogCommandResponse([]int32{int32(i)}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")}return totalRowsAffected, nil}diff --git a/backend/plugin/db/cockroachdb/cockroachdb.go b/backend/plugin/db/cockroachdb/cockroachdb.goindex 2b35712023..2cf0ea275b 100644--- a/backend/plugin/db/cockroachdb/cockroachdb.go+++ b/backend/plugin/db/cockroachdb/cockroachdb.go@@ -358,14 +358,15 @@ func (d *Driver) executeInTransactionMode(}); err != nil {return 0, errors.Wrapf(err, "failed to set role to database owner %q", owner)}- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)if err := crdb.Execute(func() error {_, err := conn.ExecContext(ctx, statement)return err}); err != nil {+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")return 0, nil}@@ -404,12 +405,12 @@ func (d *Driver) executeInTransactionMode(for i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)rr := tx.Conn().PgConn().Exec(ctx, command.Text)results, err := rr.ReadAll()if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),@@ -425,7 +426,7 @@ func (d *Driver) executeInTransactionMode(allRowsAffected = append(allRowsAffected, int32(ra))rowsAffected += ra}- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffected, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffected, "")totalRowsAffected += rowsAffected}@@ -454,15 +455,15 @@ func (d *Driver) executeInTransactionMode(// Run non-transaction statements at the end.for i, stmt := range nonTransactionAndSetRoleStmts {indexes := []int32{nonTransactionAndSetRoleStmtsIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, stmt)if err := crdb.Execute(func() error {_, err := conn.ExecContext(ctx, stmt)return err}); err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse(indexes, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")}return totalRowsAffected, nil}@@ -510,14 +511,14 @@ func (d *Driver) executeInAutoCommitMode(}); err != nil {return 0, errors.Wrapf(err, "failed to set role to database owner %q", owner)}- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)if err := crdb.Execute(func() error {_, err := conn.ExecContext(ctx, statement)return err}); err != nil {return 0, err}- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")return 0, nil}@@ -533,12 +534,12 @@ func (d *Driver) executeInAutoCommitMode(// Execute all statements individually in auto-commit modefor i, stmt := range nonTransactionAndSetRoleStmts {indexes := []int32{nonTransactionAndSetRoleStmtsIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, stmt)if err := crdb.Execute(func() error {sqlResult, err := conn.ExecContext(ctx, stmt)if err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return err}@@ -548,7 +549,7 @@ func (d *Driver) executeInAutoCommitMode(rowsAffected = 0}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalRowsAffected += rowsAffectedreturn nil}); err != nil {diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.goindex 0c63722a9f..dad190fc9a 100644--- a/backend/plugin/db/driver.go+++ b/backend/plugin/db/driver.go@@ -187,6 +187,9 @@ func Open(ctx context.Context, dbType storepb.Engine, connectionConfig Connectiotype ExecuteOptions struct {CreateDatabase boolCreateTaskRunLog func(time.Time, *storepb.TaskRunLog) error+ // If true, log the statement of the command.+ // else only log the command index.+ LogCommandStatement bool// Record the connection id first before executing.SetConnectionID func(id string)@@ -196,6 +199,34 @@ type ExecuteOptions struct {MaximumRetries int}+func (o *ExecuteOptions) LogComputeDiffStart() {+ if o == nil || o.CreateTaskRunLog == nil {+ return+ }+ err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{+ Type: storepb.TaskRunLog_COMPUTE_DIFF_START,+ ComputeDiffStart: &storepb.TaskRunLog_ComputeDiffStart{},+ })+ if err != nil {+ slog.Warn("failed to log compute diff start", log.BBError(err))+ }+}++func (o *ExecuteOptions) LogComputeDiffEnd(e string) {+ if o == nil || o.CreateTaskRunLog == nil {+ return+ }+ err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{+ Type: storepb.TaskRunLog_COMPUTE_DIFF_END,+ ComputeDiffEnd: &storepb.TaskRunLog_ComputeDiffEnd{+ Error: e,+ },+ })+ if err != nil {+ slog.Warn("failed to log compute diff end", log.BBError(err))+ }+}+func (o *ExecuteOptions) LogDatabaseSyncStart() {if o == nil || o.CreateTaskRunLog == nil {return@@ -252,29 +283,32 @@ func (o *ExecuteOptions) LogSchemaDumpEnd(derr string) {}}-func (o *ExecuteOptions) LogCommandExecute(commandIndexes []int32) {+func (o *ExecuteOptions) LogCommandExecute(commandIndexes []int32, commandText string) {if o == nil || o.CreateTaskRunLog == nil {return}+ ce := &storepb.TaskRunLog_CommandExecute{}+ if o.LogCommandStatement {+ ce.Statement = commandText+ } else {+ ce.CommandIndexes = commandIndexes+ }err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{- Type: storepb.TaskRunLog_COMMAND_EXECUTE,- CommandExecute: &storepb.TaskRunLog_CommandExecute{- CommandIndexes: commandIndexes,- },+ Type: storepb.TaskRunLog_COMMAND_EXECUTE,+ CommandExecute: ce,})if err != nil {slog.Warn("failed to log command execute", log.BBError(err))}}-func (o *ExecuteOptions) LogCommandResponse(commandIndexes []int32, affectedRows int32, allAffectedRows []int32, rerr string) {+func (o *ExecuteOptions) LogCommandResponse(affectedRows int32, allAffectedRows []int32, rerr string) {if o == nil || o.CreateTaskRunLog == nil {return}err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{Type: storepb.TaskRunLog_COMMAND_RESPONSE,CommandResponse: &storepb.TaskRunLog_CommandResponse{- CommandIndexes: commandIndexes,AffectedRows: affectedRows,AllAffectedRows: allAffectedRows,Error: rerr,diff --git a/backend/plugin/db/dynamodb/dynamodb.go b/backend/plugin/db/dynamodb/dynamodb.goindex ebbe3aad27..5609a8d082 100644--- a/backend/plugin/db/dynamodb/dynamodb.go+++ b/backend/plugin/db/dynamodb/dynamodb.go@@ -104,7 +104,7 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOnonEmptyStatements, idxMap := base.FilterEmptySQLWithIndexes(statements)for currentIndex, statement := range nonEmptyStatements {- opts.LogCommandExecute([]int32{int32(idxMap[currentIndex])})+ opts.LogCommandExecute([]int32{int32(idxMap[currentIndex])}, statement.Text)_, err := d.client.ExecuteTransaction(ctx, &dynamodb.ExecuteTransactionInput{TransactStatements: []types.ParameterizedStatement{{@@ -113,13 +113,14 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteO},})if err != nil {+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, &db.ErrorWithPosition{Err: errors.Wrap(err, "failed to execute statement"),Start: statement.Start,End: statement.End,}}- opts.LogCommandResponse([]int32{int32(currentIndex)}, 0, []int32{}, "")+ opts.LogCommandResponse(0, []int32{0}, "")}return 0, nildiff --git a/backend/plugin/db/mssql/mssql.go b/backend/plugin/db/mssql/mssql.goindex 51caea0534..52ccb92aad 100644--- a/backend/plugin/db/mssql/mssql.go+++ b/backend/plugin/db/mssql/mssql.go@@ -215,13 +215,13 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, statement string,v := batch.Batch()if v != nil && len(v.Text) > 0 {indexes := []int32{int32(idx)}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, v.Text)rowsAffected, err := execute(ctx, tx, v.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, err}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalAffectRows += rowsAffected}break@@ -238,13 +238,13 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, statement string,indexes := []int32{int32(idx)}idx++for i := uint(0); i < v.Count; i++ {- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, b.Text)rowsAffected, err := execute(ctx, tx, b.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, err}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalAffectRows += rowsAffected}default:@@ -276,13 +276,13 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, statement string,v := batch.Batch()if v != nil && len(v.Text) > 0 {indexes := []int32{int32(idx)}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, v.Text)rowsAffected, err := d.executeAutoCommit(ctx, v.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return totalAffectRows, err}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalAffectRows += rowsAffected}break@@ -299,14 +299,14 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, statement string,indexes := []int32{int32(idx)}idx++for i := uint(0); i < v.Count; i++ {- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, b.Text)rowsAffected, err := d.executeAutoCommit(ctx, b.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())// In auto-commit mode, we stop at the first errorreturn totalAffectRows, err}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalAffectRows += rowsAffected}default:diff --git a/backend/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.goindex 04a911b319..ae6744d3aa 100644--- a/backend/plugin/db/mysql/mysql.go+++ b/backend/plugin/db/mysql/mysql.go@@ -352,7 +352,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, cfor i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlWithBytebaseAppComment := util.MySQLPrependBytebaseAppComment(command.Text)sqlResult, err := exer.ExecContext(ctx, sqlWithBytebaseAppComment, nil)@@ -364,7 +364,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, c}}- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),@@ -382,7 +382,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, c}totalRowsAffected += rowsAffected- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffectedInt32, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffectedInt32, "")}if err := tx.Commit(); err != nil {@@ -410,7 +410,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, cofor i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlWithBytebaseAppComment := util.MySQLPrependBytebaseAppComment(command.Text)sqlResult, err := exer.ExecContext(ctx, sqlWithBytebaseAppComment, nil)@@ -422,7 +422,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, co}}- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())// In auto-commit mode, we stop at the first error// The database is left in a partially migrated statereturn &db.ErrorWithPosition{@@ -441,7 +441,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, co}totalRowsAffected += rowsAffected- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffectedInt32, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffectedInt32, "")}return nildiff --git a/backend/plugin/db/oracle/oracle.go b/backend/plugin/db/oracle/oracle.goindex f1269a45e6..b600ba9a99 100644--- a/backend/plugin/db/oracle/oracle.go+++ b/backend/plugin/db/oracle/oracle.go@@ -182,11 +182,11 @@ func (*Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, comtotalRowsAffected := int64(0)for i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlResult, err := tx.ExecContext(ctx, command.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),Start: command.Start,@@ -199,7 +199,7 @@ func (*Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, comslog.Debug("rowsAffected returns error", log.BBError(err))rowsAffected = 0}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalRowsAffected += rowsAffected}@@ -217,11 +217,11 @@ func (*Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, commtotalRowsAffected := int64(0)for i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlResult, err := conn.ExecContext(ctx, command.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())// In auto-commit mode, we stop at the first error// The database is left in a partially migrated statereturn totalRowsAffected, &db.ErrorWithPosition{@@ -236,7 +236,7 @@ func (*Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, commslog.Debug("rowsAffected returns error", log.BBError(err))rowsAffected = 0}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalRowsAffected += rowsAffected}return totalRowsAffected, nildiff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.goindex f5ed0486f2..4b1e80c34d 100644--- a/backend/plugin/db/pg/pg.go+++ b/backend/plugin/db/pg/pg.go@@ -512,12 +512,12 @@ func (d *Driver) executeInTransactionMode(return 0, errors.Wrapf(err, "failed to set role to database owner %q", owner)}}- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)if _, err := conn.ExecContext(ctx, statement); err != nil {- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")return 0, nil}@@ -558,12 +558,12 @@ func (d *Driver) executeInTransactionMode(for i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)rr := tx.Conn().PgConn().Exec(ctx, command.Text)results, err := rr.ReadAll()if err != nil {- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),@@ -579,7 +579,7 @@ func (d *Driver) executeInTransactionMode(allRowsAffected = append(allRowsAffected, int32(ra))rowsAffected += ra}- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffected, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffected, "")totalRowsAffected += rowsAffected}@@ -612,12 +612,12 @@ func (d *Driver) executeInTransactionMode(// Run non-transaction statements at the end.for i, stmt := range nonTransactionAndSetRoleStmts {indexes := []int32{nonTransactionAndSetRoleStmtsIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, stmt)if _, err := conn.ExecContext(ctx, stmt); err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse(indexes, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")}return totalRowsAffected, nil}@@ -664,12 +664,12 @@ func (d *Driver) executeInAutoCommitMode(return 0, errors.Wrapf(err, "failed to set role to database owner %q", owner)}}- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)if _, err := conn.ExecContext(ctx, statement); err != nil {- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse([]int32{0}, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")return 0, nil}@@ -684,11 +684,11 @@ func (d *Driver) executeInAutoCommitMode(// Execute all statements individually in auto-commit modefor i, stmt := range nonTransactionAndSetRoleStmts {indexes := []int32{nonTransactionAndSetRoleStmtsIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, stmt)sqlResult, err := conn.ExecContext(ctx, stmt)if err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())if isLockTimeoutError(err.Error()) {return totalRowsAffected, &LockTimeoutError{Message: err.Error(),@@ -703,7 +703,7 @@ func (d *Driver) executeInAutoCommitMode(rowsAffected = 0}- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")totalRowsAffected += rowsAffected}diff --git a/backend/plugin/db/redshift/redshift.go b/backend/plugin/db/redshift/redshift.goindex 96a6f50c3e..fe422512c5 100644--- a/backend/plugin/db/redshift/redshift.go+++ b/backend/plugin/db/redshift/redshift.go@@ -255,10 +255,10 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, commands []base.S}()for i, command := range commands {- opts.LogCommandExecute([]int32{int32(i)})+ opts.LogCommandExecute([]int32{int32(i)}, command.Text)sqlResult, err := tx.ExecContext(ctx, command.Text)if err != nil {- opts.LogCommandResponse([]int32{int32(i)}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),Start: command.Start,@@ -270,7 +270,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, commands []base.S// Since we cannot differentiate DDL and DML yet, we have to ignore the error.slog.Debug("rowsAffected returns error", log.BBError(err))}- opts.LogCommandResponse([]int32{int32(i)}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")totalRowsAffected += rowsAffected}@@ -289,10 +289,10 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, commands []base.SitotalRowsAffected := int64(0)for i, command := range commands {- opts.LogCommandExecute([]int32{int32(i)})+ opts.LogCommandExecute([]int32{int32(i)}, command.Text)sqlResult, err := d.db.ExecContext(ctx, command.Text)if err != nil {- opts.LogCommandResponse([]int32{int32(i)}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())// In auto-commit mode, we stop at the first error// The database is left in a partially migrated statereturn totalRowsAffected, &db.ErrorWithPosition{@@ -306,7 +306,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, commands []base.Si// Since we cannot differentiate DDL and DML yet, we have to ignore the error.slog.Debug("rowsAffected returns error", log.BBError(err))}- opts.LogCommandResponse([]int32{int32(i)}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")totalRowsAffected += rowsAffected}diff --git a/backend/plugin/db/snowflake/snowflake.go b/backend/plugin/db/snowflake/snowflake.goindex c705ba67ec..ed0878aa10 100644--- a/backend/plugin/db/snowflake/snowflake.go+++ b/backend/plugin/db/snowflake/snowflake.go@@ -273,11 +273,11 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, statement string,}// Log the entire multi-statement execution- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)result, err := tx.ExecContext(mctx, statement)if err != nil {- opts.LogCommandResponse([]int32{0}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, err}@@ -292,10 +292,10 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, statement string,// Since we cannot differentiate DDL and DML yet, we have to ignore the error.if err != nil {slog.Debug("rowsAffected returns error", log.BBError(err))- opts.LogCommandResponse([]int32{0}, 0, nil, "")+ opts.LogCommandResponse(0, nil, "")return 0, nil}- opts.LogCommandResponse([]int32{0}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")return rowsAffected, nil}@@ -309,11 +309,11 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, statement string,}// Log the entire multi-statement execution- opts.LogCommandExecute([]int32{0})+ opts.LogCommandExecute([]int32{0}, statement)result, err := d.db.ExecContext(mctx, statement)if err != nil {- opts.LogCommandResponse([]int32{0}, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return 0, err}@@ -321,10 +321,10 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, statement string,// Since we cannot differentiate DDL and DML yet, we have to ignore the error.if err != nil {slog.Debug("rowsAffected returns error", log.BBError(err))- opts.LogCommandResponse([]int32{0}, 0, nil, "")+ opts.LogCommandResponse(0, nil, "")return 0, nil}- opts.LogCommandResponse([]int32{0}, int32(rowsAffected), nil, "")+ opts.LogCommandResponse(int32(rowsAffected), nil, "")return rowsAffected, nil}diff --git a/backend/plugin/db/tidb/tidb.go b/backend/plugin/db/tidb/tidb.goindex 321d13d879..360ee93ed4 100644--- a/backend/plugin/db/tidb/tidb.go+++ b/backend/plugin/db/tidb/tidb.go@@ -264,7 +264,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, cfor i, command := range commands {indexes := []int32{originalIndex[remainingSQLsIndex[i]]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlWithBytebaseAppComment := util.MySQLPrependBytebaseAppComment(command.Text)sqlResult, err := exer.ExecContext(ctx, sqlWithBytebaseAppComment, nil)@@ -276,7 +276,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, c}}- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())return &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),@@ -294,7 +294,7 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, c}totalRowsAffected += rowsAffected- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffectedInt32, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffectedInt32, "")}if err := tx.Commit(); err != nil {@@ -312,12 +312,12 @@ func (d *Driver) executeInTransactionMode(ctx context.Context, conn *sql.Conn, c// Run non-transaction statements at the end.for i, stmt := range nonTransactionStmts {indexes := []int32{originalIndex[nonTransactionStmtsIndex[i]]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, stmt.Text)if _, err := d.db.ExecContext(ctx, stmt.Text); err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return 0, err}- opts.LogCommandResponse(indexes, 0, []int32{0}, "")+ opts.LogCommandResponse(0, []int32{0}, "")}return totalRowsAffected, nil}@@ -358,7 +358,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, cofor i, command := range allCommands {indexes := []int32{originalIndex[allIndexes[i]]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)sqlWithBytebaseAppComment := util.MySQLPrependBytebaseAppComment(command.Text)sqlResult, err := exer.ExecContext(ctx, sqlWithBytebaseAppComment, nil)@@ -370,7 +370,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, co}}- opts.LogCommandResponse(indexes, 0, nil, err.Error())+ opts.LogCommandResponse(0, nil, err.Error())// In auto-commit mode, we stop at the first error// The database is left in a partially migrated statereturn &db.ErrorWithPosition{@@ -389,7 +389,7 @@ func (d *Driver) executeInAutoCommitMode(ctx context.Context, conn *sql.Conn, co}totalRowsAffected += rowsAffected- opts.LogCommandResponse(indexes, int32(rowsAffected), allRowsAffectedInt32, "")+ opts.LogCommandResponse(int32(rowsAffected), allRowsAffectedInt32, "")}return nildiff --git a/backend/plugin/db/trino/trino.go b/backend/plugin/db/trino/trino.goindex 4ab43be051..3e307ae771 100644--- a/backend/plugin/db/trino/trino.go+++ b/backend/plugin/db/trino/trino.go@@ -157,11 +157,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOvar totalRowsAffected int64for i, command := range commands {indexes := []int32{originalIndex[i]}- opts.LogCommandExecute(indexes)+ opts.LogCommandExecute(indexes, command.Text)result, err := conn.ExecContext(ctx, command.Text)if err != nil {- opts.LogCommandResponse(indexes, 0, []int32{0}, err.Error())+ opts.LogCommandResponse(0, []int32{0}, err.Error())return totalRowsAffected, errors.Wrapf(err, "failed to execute statement")}@@ -172,7 +172,7 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteO}totalRowsAffected += rowsAffected- opts.LogCommandResponse(indexes, int32(rowsAffected), []int32{int32(rowsAffected)}, "")+ opts.LogCommandResponse(int32(rowsAffected), []int32{int32(rowsAffected)}, "")}return totalRowsAffected, nildiff --git a/backend/runner/taskrun/schema_update_sdl_executor.go b/backend/runner/taskrun/schema_update_sdl_executor.goindex 686b955fef..85854f4167 100644--- a/backend/runner/taskrun/schema_update_sdl_executor.go+++ b/backend/runner/taskrun/schema_update_sdl_executor.go@@ -59,11 +59,16 @@ func (exec *SchemaDeclareExecutor) RunOnce(ctx context.Context, driverCtx contex}execFunc := func(ctx context.Context, execStatement string, driver db.Driver, opts db.ExecuteOptions) error {- // TODO(p0ny): log diff and migration SQL+ opts.LogComputeDiffStart()migrationSQL, err := diff(ctx, exec.store, instance, database, execStatement)if err != nil {+ opts.LogComputeDiffEnd(err.Error())return errors.Wrapf(err, "failed to diff database schema")}+ opts.LogComputeDiffEnd("")++ // Log statement string.+ opts.LogCommandStatement = trueif _, err := driver.Execute(ctx, migrationSQL, opts); err != nil {return err}diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/DetailCell.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/DetailCell.vueindex e2e1ba9c94..5b2d7f2caf 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/DetailCell.vue+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/DetailCell.vue@@ -54,18 +54,13 @@ const view = computed((): View => {retryInfo,} = props.entry;if (type === TaskRunLogEntry_Type.COMMAND_EXECUTE && commandExecute) {- if (!commandExecute.raw.response) {- return "N/A";- }- if (commandExecute.raw.response.error) {+ if (commandExecute.error) {return "ERROR";}if (typeof commandExecute.affectedRows !== "undefined") {return "AFFECTED_ROWS";}- if (typeof commandExecute.raw.response.affectedRows !== "undefined") {- return "AFFECTED_ROWS";- }+ return "N/A";}if (type === TaskRunLogEntry_Type.TASK_RUN_STATUS_UPDATE &&diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/ErrorCell.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/ErrorCell.vueindex c92dccac05..b0b3820d9e 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/ErrorCell.vue+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/ErrorCell.vue@@ -19,7 +19,7 @@ const error = computed(() => {entry.commandExecute) {const exec = entry.commandExecute;- return exec.raw.response?.error;+ return exec.error;}if (entry.type === TaskRunLogEntry_Type.PRIOR_BACKUP && entry.priorBackup) {return entry.priorBackup.error;diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/common.ts b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/common.tsindex f5be289ada..6edc335999 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/common.ts+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/DetailCell/common.ts@@ -7,17 +7,15 @@ export const detailCellRowSpan = (entry: FlattenLogEntry) => {entry.commandExecute) {const { commandExecute } = entry;- if (!commandExecute.raw.response) {- // Not finished yet, combine several rows- return commandExecute.raw.commandIndexes.length;- }- if (commandExecute.raw.response.error) {- // Error, combine several rows- return commandExecute.raw.commandIndexes.length;- }- if (typeof commandExecute.affectedRows !== "undefined") {- // Has detailed affectedRows for each command- return 1;+ if (commandExecute.kind === "commandIndexes") {+ if (!commandExecute.done) {+ // Not finished yet, combine several rows+ return commandExecute.commandIndexes.length;+ }+ if (commandExecute.error) {+ // Error, combine several rows+ return commandExecute.commandIndexes.length;+ }}}return 1;diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/StatementCell.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/StatementCell.vueindex b8f43c8c5b..567b71f89d 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/StatementCell.vue+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/StatementCell.vue@@ -51,6 +51,9 @@ const statement = computed(() => {entry.type === TaskRunLogEntry_Type.COMMAND_EXECUTE &&entry.commandExecute) {+ if (entry.commandExecute.kind === "statement") {+ return entry.commandExecute.statement;+ }if (!sheet) {return "";}diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/TaskRunLogTable.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/TaskRunLogTable.vueindex 87c2a70166..634f5d03d2 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/TaskRunLogTable.vue+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/TaskRunLogTable.vue@@ -79,17 +79,24 @@ const rowSpan = (entry: FlattenLogEntry) => {entry.commandExecute) {const { commandExecute } = entry;- return commandExecute.raw.commandIndexes.length;+ if (commandExecute.kind === "commandIndexes") {+ return commandExecute.commandIndexes.length;+ }+ return 1;}return 1;};+const colSpan = (entry: FlattenLogEntry) => {if (entry.type === TaskRunLogEntry_Type.COMMAND_EXECUTE &&entry.commandExecute) {const { commandExecute } = entry;- if (commandExecute.raw.commandIndexes.length > 1) {+ if (+ commandExecute.kind === "commandIndexes" &&+ commandExecute.commandIndexes.length > 1+ ) {return 1;}}diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/common.ts b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/common.tsindex c185219b61..cbe865e6ba 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/common.ts+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunLogTable/common.ts@@ -2,7 +2,6 @@ import { t } from "@/plugins/i18n";import { getDateForPbTimestampProtoEs } from "@/types";import {TaskRunLogEntry_Type,- type TaskRunLogEntry_CommandExecute,type TaskRunLogEntry_SchemaDump,type TaskRunLogEntry_TaskRunStatusUpdate,type TaskRunLogEntry_TransactionControl,@@ -10,6 +9,7 @@ import {type TaskRunLogEntry,type TaskRunLogEntry_PriorBackup,type TaskRunLogEntry_RetryInfo,+ type TaskRunLogEntry_ComputeDiff,} from "@/types/proto-es/v1/rollout_service_pb";export type FlattenLogEntry = {@@ -20,16 +20,28 @@ export type FlattenLogEntry = {startTime?: Date;endTime?: Date;schemaDump?: TaskRunLogEntry_SchemaDump;- commandExecute?: {- raw: TaskRunLogEntry_CommandExecute;- commandIndex: number;- affectedRows?: number;- };+ commandExecute?:+ | {+ kind: "commandIndexes";+ commandIndex: number;+ commandIndexes: number[];+ done: boolean;+ affectedRows?: number;+ error?: string;+ }+ | {+ kind: "statement";+ statement: string;+ done: boolean;+ affectedRows?: number;+ error?: string;+ };taskRunStatusUpdate?: TaskRunLogEntry_TaskRunStatusUpdate;transactionControl?: TaskRunLogEntry_TransactionControl;databaseSync?: TaskRunLogEntry_DatabaseSync;priorBackup?: TaskRunLogEntry_PriorBackup;retryInfo?: TaskRunLogEntry_RetryInfo;+ computeDiff?: TaskRunLogEntry_ComputeDiff;};export const displayTaskRunLogEntryType = (type: TaskRunLogEntry_Type) => {@@ -51,6 +63,9 @@ export const displayTaskRunLogEntryType = (type: TaskRunLogEntry_Type) => {if (type === TaskRunLogEntry_Type.PRIOR_BACKUP) {return t("issue.task-run.task-run-log.entry-type.prior-backup");}+ if (type === TaskRunLogEntry_Type.COMPUTE_DIFF) {+ return t("issue.task-run.task-run-log.entry-type.compute-diff");+ }if (type === TaskRunLogEntry_Type.RETRY_INFO) {return t("issue.task-run.task-run-log.entry-type.retry-info");}@@ -75,6 +90,7 @@ export const convertTaskRunLogEntryToFlattenLogEntries = (deployId,priorBackup,retryInfo,+ computeDiff,} = entry;const flattenLogEntries: FlattenLogEntry[] = [];if (@@ -126,29 +142,50 @@ export const convertTaskRunLogEntryToFlattenLogEntries = (}if (type === TaskRunLogEntry_Type.COMMAND_EXECUTE && commandExecute) {const { response, logTime: startTime } = commandExecute;- commandExecute.commandIndexes.forEach((commandIndex, serial) => {- let affectedRows = response?.affectedRows;- if (- commandExecute.commandIndexes.length ===- response?.allAffectedRows.length- ) {- affectedRows = response?.allAffectedRows[serial] ?? affectedRows;- }- const endTime = response?.logTime;+ if (commandExecute.statement) {flattenLogEntries.push({batch,deployId,- serial,+ serial: 0,type: TaskRunLogEntry_Type.COMMAND_EXECUTE,startTime: getDateForPbTimestampProtoEs(startTime),- endTime: getDateForPbTimestampProtoEs(endTime),+ endTime: getDateForPbTimestampProtoEs(response?.logTime),commandExecute: {- raw: commandExecute,- commandIndex,- affectedRows,+ kind: "statement",+ statement: commandExecute.statement,+ done: !!response,+ affectedRows: response?.affectedRows,+ error: response?.error,},});- });+ } else {+ commandExecute.commandIndexes.forEach((commandIndex, serial) => {+ let affectedRows = response?.affectedRows;+ if (+ commandExecute.commandIndexes.length ===+ response?.allAffectedRows.length+ ) {+ affectedRows = response?.allAffectedRows[serial] ?? affectedRows;+ }+ const endTime = response?.logTime;+ flattenLogEntries.push({+ batch,+ deployId,+ serial,+ type: TaskRunLogEntry_Type.COMMAND_EXECUTE,+ startTime: getDateForPbTimestampProtoEs(startTime),+ endTime: getDateForPbTimestampProtoEs(endTime),+ commandExecute: {+ kind: "commandIndexes",+ commandIndex: commandIndex,+ commandIndexes: commandExecute.commandIndexes,+ done: !!response,+ affectedRows: affectedRows,+ error: response?.error,+ },+ });+ });+ }}if (type === TaskRunLogEntry_Type.PRIOR_BACKUP && priorBackup) {flattenLogEntries.push({@@ -161,6 +198,17 @@ export const convertTaskRunLogEntryToFlattenLogEntries = (priorBackup: priorBackup,});}+ if (type === TaskRunLogEntry_Type.COMPUTE_DIFF && computeDiff) {+ flattenLogEntries.push({+ batch,+ deployId,+ serial: 0,+ type: TaskRunLogEntry_Type.COMPUTE_DIFF,+ startTime: getDateForPbTimestampProtoEs(computeDiff.startTime),+ endTime: getDateForPbTimestampProtoEs(computeDiff.endTime),+ computeDiff,+ });+ }if (type === TaskRunLogEntry_Type.RETRY_INFO && retryInfo) {flattenLogEntries.push({batch,diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 0dd4ac9df4..691481cde9 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1036,7 +1036,8 @@"transaction-control": "Transaction control","database-sync": "Database sync","prior-backup": "Prior backup",- "retry-info": "Retry information"+ "retry-info": "Retry information",+ "compute-diff": "Compute diff"},"affected-rows-n": "Affected rows: {n}","prior-backup-tables": "Prior backup tables",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex f9f4abcc61..99017fc806 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1036,7 +1036,8 @@"transaction-control": "Control de transacciones","database-sync": "Sincronización de base de datos","prior-backup": "Copia de seguridad previa",- "retry-info": "Reintento de información"+ "retry-info": "Reintento de información",+ "compute-diff": "Calcular diff"},"affected-rows-n": "Filas afectadas: {n}","prior-backup-tables": "Tablas de respaldo anteriores",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 52464522aa..a689013136 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -1036,7 +1036,8 @@"transaction-control": "トランザクション制御","database-sync": "データベースの同期","prior-backup": "事前のバックアップ",- "retry-info": "情報を再試行します"+ "retry-info": "情報を再試行します",+ "compute-diff": "Diffを計算します"},"affected-rows-n": "影響行数: {n}","prior-backup-tables": "以前のバックアップテーブル",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 89b0a5495c..477f62a979 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -1036,7 +1036,8 @@"transaction-control": "Kiểm soát giao dịch","database-sync": "Đồng bộ cơ sở dữ liệu","prior-backup": "Sao lưu trước",- "retry-info": "Thông tin thử lại"+ "retry-info": "Thông tin thử lại",+ "compute-diff": "Tính toán khác"},"affected-rows-n": "Số dòng bị ảnh hưởng: {n}","prior-backup-tables": "Bảng sao lưu trước",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 20668a1832..c2306ef346 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1036,7 +1036,8 @@"transaction-control": "事务控制","database-sync": "数据库同步","prior-backup": "数据预备份",- "retry-info": "重试信息"+ "retry-info": "重试信息",+ "compute-diff": "计算差异"},"affected-rows-n": "影响行数:{n}","prior-backup-tables": "数据预备份相关的表",