Skip to content

Commit

Permalink
Merge pull request Altinity#942 from fiddler-labs/restore-db-mapping-…
Browse files Browse the repository at this point in the history
…regex-fix

Fix wrong restoration of Materialized views with view name starting with digits
  • Loading branch information
Slach authored Jun 30, 2024
2 parents 100d30a + 3e87f21 commit 57834ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/backup/table_pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (b *Backuper) enrichTablePatternsByInnerDependencies(metadataPath string, t
return tablePatterns, nil
}

var queryRE = regexp.MustCompile(`(?m)^(CREATE|ATTACH) (TABLE|VIEW|LIVE VIEW|MATERIALIZED VIEW|DICTIONARY|FUNCTION) (\x60?)([^\s\x60.]*)(\x60?)\.([^\s\x60.]*)(?:( UUID '[^']+'))?(?:( TO )(\x60?)([^\s\x60.]*)(\x60?)(\.))?(?:(.+FROM )(\x60?)([^\s\x60.]*)(\x60?)(\.))?`)
var queryRE = regexp.MustCompile(`(?m)^(CREATE|ATTACH) (TABLE|VIEW|LIVE VIEW|MATERIALIZED VIEW|DICTIONARY|FUNCTION) (\x60?)([^\s\x60.]*)(\x60?)\.\x60?([^\s\x60.]*)\x60?( UUID '[^']+')?(?:( TO )(\x60?)([^\s\x60.]*)(\x60?)(\.))?(?:(.+FROM )(\x60?)([^\s\x60.]*)(\x60?)(\.))?`)
var createOrAttachRE = regexp.MustCompile(`(?m)^(CREATE|ATTACH)`)
var uuidRE = regexp.MustCompile(`UUID '([a-f\d\-]+)'`)

Expand Down

0 comments on commit 57834ab

Please sign in to comment.