From 2931749ba89c301ae519bfa55787bd66799aacfc Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Mon, 27 Apr 2026 10:14:04 +0000 Subject: [PATCH] fix(backup): use ConvertProtoBackupStrategyToDriver instead of String() for backup strategy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gRPC server's Backup() method was using req.BackupStrategy.String() which returns the proto enum name "OriginalRow" (PascalCase), but the plugin's Backup() expects "original_row" (snake_case). This caused "不支持的备份类型: OriginalRow, 未执行备份" errors when executing backup for DELETE/UPDATE statements on TiDB data sources. Fix: use the existing ConvertProtoBackupStrategyToDriver() function which correctly maps proto enum values to driver string constants. Fixes: BUG-004 --- sqle/driver/v2/driver_grpc_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqle/driver/v2/driver_grpc_server.go b/sqle/driver/v2/driver_grpc_server.go index 7a11ae172d..6858ccc147 100644 --- a/sqle/driver/v2/driver_grpc_server.go +++ b/sqle/driver/v2/driver_grpc_server.go @@ -115,7 +115,7 @@ func (d *DriverGrpcServer) Backup(ctx context.Context, req *protoV2.BackupReq) ( return &protoV2.BackupRes{}, err } res, err := driver.Backup(ctx, &BackupReq{ - BackupStrategy: req.BackupStrategy.String(), + BackupStrategy: ConvertProtoBackupStrategyToDriver(req.BackupStrategy), Sql: req.Sql, BackupMaxRows: req.BackupMaxRows, })