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] 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...) } }