From 5ba6308854fe1c71f6390a982720f4e6b463fe4e Mon Sep 17 00:00:00 2001 From: YenchangChan <43897067+YenchangChan@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:01:52 +0800 Subject: [PATCH 1/2] ci/cd failed issue (#187) * fix: clickhouse query issue * fix: make systest --- go.test.sh | 18 +++++++++--------- pool/ck_cli.go | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.test.sh b/go.test.sh index 3df7bb08..98a4ba98 100755 --- a/go.test.sh +++ b/go.test.sh @@ -49,9 +49,9 @@ sudo docker exec kafka kafka-topics --bootstrap-server localhost:9093 --topic to sudo docker exec kafka sh /tmp/send.sh echo "start clickhouse_sinker to consume" -timeout 30 ./clickhouse_sinker --local-cfg-file docker/test_fixed_schema.hjson -timeout 30 ./clickhouse_sinker --local-cfg-file docker/test_auto_schema.hjson -timeout 60 ./clickhouse_sinker --local-cfg-file docker/test_dynamic_schema.hjson +timeout 30 ./bin/clickhouse_sinker --local-cfg-file docker/test_fixed_schema.hjson +timeout 30 ./bin/clickhouse_sinker --local-cfg-file docker/test_auto_schema.hjson +timeout 60 ./bin/clickhouse_sinker --local-cfg-file docker/test_dynamic_schema.hjson echo "check result 1" count=`curl "localhost:8123" -d 'select count() from test_fixed_schema'` @@ -75,19 +75,19 @@ curl "localhost:8123" -d 'TRUNCATE TABLE test_auto_schema' curl "localhost:8123" -d 'TRUNCATE TABLE test_dynamic_schema' echo "publish clickhouse_sinker config" -./nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_fixed_schema --local-cfg-file docker/test_fixed_schema.hjson -./nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_auto_schema --local-cfg-file docker/test_auto_schema.hjson -./nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_dynamic_schema --local-cfg-file docker/test_dynamic_schema.hjson +./bin/nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_fixed_schema --local-cfg-file docker/test_fixed_schema.hjson +./bin/nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_auto_schema --local-cfg-file docker/test_auto_schema.hjson +./bin/nacos_publish_config --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_dynamic_schema --local-cfg-file docker/test_dynamic_schema.hjson echo "start clickhouse_sinker to consume" sudo docker exec kafka kafka-consumer-groups --bootstrap-server localhost:9093 --execute --reset-offsets --group test_fixed_schema --all-topics --to-earliest -timeout 30 ./clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_fixed_schema +timeout 30 ./bin/clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_fixed_schema sudo docker exec kafka kafka-consumer-groups --bootstrap-server localhost:9093 --execute --reset-offsets --group test_auto_schema --all-topics --to-earliest -timeout 30 ./clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_auto_schema +timeout 30 ./bin/clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_auto_schema sudo docker exec kafka kafka-consumer-groups --bootstrap-server localhost:9093 --execute --reset-offsets --group test_dynamic_schema --all-topics --to-earliest -timeout 30 ./clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_dynamic_schema +timeout 30 ./bin/clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_dynamic_schema echo "check result 2" count=`curl "localhost:8123" -d 'select count() from test_fixed_schema'` diff --git a/pool/ck_cli.go b/pool/ck_cli.go index 6624c480..d2d98670 100644 --- a/pool/ck_cli.go +++ b/pool/ck_cli.go @@ -77,14 +77,14 @@ func (c *Conn) Query(query string, args ...any) (*Rows, error) { var rs Rows rs.protocol = c.protocol if c.protocol == clickhouse.HTTP { - rows, err := c.db.Query(query, args) + rows, err := c.db.Query(query, args...) if err != nil { return &rs, err } else { rs.rs1 = rows } } else { - rows, err := c.c.Query(c.ctx, query, args) + rows, err := c.c.Query(c.ctx, query, args...) if err != nil { return &rs, err } else { @@ -98,19 +98,19 @@ func (c *Conn) QueryRow(query string, args ...any) *Row { var row Row row.proto = c.protocol if c.protocol == clickhouse.HTTP { - row.r1 = c.db.QueryRow(query, args) + row.r1 = c.db.QueryRow(query, args...) } else { - row.r2 = c.c.QueryRow(c.ctx, query, args) + row.r2 = c.c.QueryRow(c.ctx, query, args...) } return &row } func (c *Conn) Exec(query string, args ...any) error { if c.protocol == clickhouse.HTTP { - _, err := c.db.Exec(query, args) + _, err := c.db.Exec(query, args...) return err } else { - return c.c.Exec(c.ctx, query, args) + return c.c.Exec(c.ctx, query, args...) } } From a07826d4454c2d932090a5e7c5a7bd1b1130c9e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:20:52 +0800 Subject: [PATCH 2/2] Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#185) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0. - [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9b20c4a1..4db3ee67 100644 --- a/go.mod +++ b/go.mod @@ -77,10 +77,10 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index f9b7a32d..441d09e9 100644 --- a/go.sum +++ b/go.sum @@ -273,8 +273,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -319,8 +319,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=