Skip to content

Commit 4d8567a

Browse files
committed
update go.mod, fix integration_test.go for clickhouse 20.5- version where "\" replaced to "", fix https://github.com/Altinity/clickhouse-backup/issue/1091
Signed-off-by: Slach <bloodjazman@gmail.com>
1 parent a65041a commit 4d8567a

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ require (
2828
github.com/jlaffaye/ftp v0.2.0
2929
github.com/jolestar/go-commons-pool/v2 v2.1.2
3030
github.com/kelseyhightower/envconfig v1.4.0
31-
github.com/klauspost/compress v1.17.11
31+
github.com/klauspost/compress v1.18.0
3232
github.com/mattn/go-shellwords v1.0.12
3333
github.com/mholt/archiver/v4 v4.0.0-alpha.9
3434
github.com/otiai10/copy v1.14.1
3535
github.com/pkg/errors v0.9.1
3636
github.com/pkg/sftp v1.13.7
37-
github.com/prometheus/client_golang v1.20.5
37+
github.com/prometheus/client_golang v1.21.0
3838
github.com/puzpuzpuz/xsync v1.5.2
3939
github.com/ricochet2200/go-disk-usage/du v0.0.0-20210707232629-ac9918953285
4040
github.com/rs/zerolog v1.33.0

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
275275
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
276276
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
277277
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
278+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
279+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
278280
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
279281
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
280282
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
@@ -334,6 +336,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
334336
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
335337
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
336338
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
339+
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
340+
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
337341
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
338342
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
339343
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=

test/integration/integration_test.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,24 @@ import (
4343
var projectId atomic.Uint32
4444
var dockerPool *pool.ObjectPool
4545

46+
var dbNameAtomic = "_test#$.ДБ_atomic_/issue\\_1091"
47+
var dbNameOrdinary = "_test#$.ДБ_ordinary_/issue\\_1091"
48+
var dbNameMySQL = "mysql_db"
49+
var dbNamePostgreSQL = "pgsql_db"
50+
var Issue331Issue1091Atomic = "_issue331._atomic_/issue\\_1091"
51+
var Issue331Issue1091Ordinary = "_issue331.ordinary_/issue\\_1091"
52+
4653
// setup log level
4754
func init() {
55+
// old version replace \ to nothing, https://github.com/Altinity/clickhouse-backup/issue/1091
56+
if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "20.5") < 0 {
57+
dbNameAtomic = "_test#$.ДБ_atomic_/issue_1091"
58+
dbNameOrdinary = "_test#$.ДБ_ordinary_/issue_1091"
59+
dbNameMySQL = "mysql_db"
60+
dbNamePostgreSQL = "pgsql_db"
61+
Issue331Issue1091Atomic = "_issue331._atomic_/issue_1091"
62+
Issue331Issue1091Ordinary = "_issue331.ordinary_/issue_1091"
63+
}
4864
zerolog.TimeFieldFormat = zerolog.TimeFormatUnixMs
4965
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
5066
consoleWriter := zerolog.ConsoleWriter{Out: os.Stderr, NoColor: true, TimeFormat: "2006-01-02 15:04:05.000"}
@@ -79,13 +95,6 @@ func init() {
7995
dockerPool.Config.MaxTotal = runParallelInt
8096
}
8197

82-
const dbNameAtomic = "_test#$.ДБ_atomic_/issue\\_1091"
83-
const dbNameOrdinary = "_test#$.ДБ_ordinary_/issue\\_1091"
84-
const dbNameMySQL = "mysql_db"
85-
const dbNamePostgreSQL = "pgsql_db"
86-
const Issue331Issue1091Atomic = "_issue331._atomic_/issue\\_1091"
87-
const Issue331Issue1091Ordinary = "_issue331.ordinary_/issue\\_1091"
88-
8998
type TestDataStruct struct {
9099
Database string
91100
DatabaseEngine string

0 commit comments

Comments
 (0)