diff --git a/ChangeLog.md b/ChangeLog.md index bf5854f8..b9e1922c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +# v2.5.25 +BUG FIXES +- fix corner cases for wrong parsing RBAC name, during resolve conflict for complex multi line RBAC objects, fix [976](https://github.com/Altinity/clickhouse-backup/issues/976) + # v2.5.24 BUG FIXES - fix corner cases object disk parse endpoint for S3, to avoid wrong `.amazonaws.amazonaws.com` suffix diff --git a/pkg/backup/restore.go b/pkg/backup/restore.go index d075b6c1..84c5d60a 100644 --- a/pkg/backup/restore.go +++ b/pkg/backup/restore.go @@ -692,7 +692,11 @@ func (b *Backuper) detectRBACObject(sql string) (string, string, error) { if strings.HasPrefix(sql, prefix) { kind = k // Extract the name from the SQL query. - name = strings.TrimSpace(strings.TrimPrefix(sql, prefix)) + if semicolonIdx := strings.Index(sql, ";"); semicolonIdx >= 0 { + name = strings.TrimSpace(strings.TrimPrefix(sql[:semicolonIdx], prefix)) + } else { + name = strings.TrimSpace(strings.TrimPrefix(sql, prefix)) + } break } }