diff --git a/Makefile b/Makefile index 06ef6c1..1bbc361 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/bash init: GO111MODULE=on go mod vendor - go install github.com/golangci/golangci-lint/...@v1.35.2 + go install github.com/golangci/golangci-lint/...@v1.56.2 up_docker_server: stop_docker_server docker run --rm=true -p 8123:8123 -p 9000:9000 --name dbr-clickhouse-server -d clickhouse/clickhouse-server:latest; diff --git a/conn_go18_test.go b/conn_go18_test.go index a054c5d..45955a9 100644 --- a/conn_go18_test.go +++ b/conn_go18_test.go @@ -47,7 +47,7 @@ func (s *connSuite) TestPassRequestQueryParamsFromContext() { ctx = context.WithValue(context.Background(), RequestQueryParams, map[string]string{ "no_cache": "1", }) - s.EqualError(s.conn.PingContext(ctx), "Code: 115, Message: Unknown setting no_cache") + s.EqualError(s.conn.PingContext(ctx), "Code: 115, Message: Setting no_cache is neither a builtin setting nor started with the prefix 'SQL_' registered for user-defined settings") } func (s *connSuite) TestColumnTypes() { diff --git a/conn_test.go b/conn_test.go index 7021b90..223c277 100644 --- a/conn_test.go +++ b/conn_test.go @@ -179,9 +179,9 @@ func (s *connSuite) TestServerError() { _, err := s.conn.Query("SELECT 1 FROM '???'") srvErr, ok := err.(*Error) s.Require().True(ok, err.Error()) - s.Equal(62, srvErr.Code) - s.Contains(srvErr.Message, "Syntax error:") - s.Contains(srvErr.Error(), "Code: 62, Message: Syntax error:") + s.Equal(60, srvErr.Code) + s.Contains(srvErr.Message, "Table default") + s.Contains(srvErr.Error(), "Code: 60, Message: Table default") } func (s *connSuite) TestServerKillQuery() { diff --git a/typeparser.go b/typeparser.go index 922b096..00951cb 100644 --- a/typeparser.go +++ b/typeparser.go @@ -60,21 +60,25 @@ func parseTypeDesc(tokens []*token) (*TypeDesc, []*token, error) { } } -// ParseTypeDesc parses the type description that ClickHouse provides. -// -// The grammar is quite simple: -// desc -// name -// name() -// name(args) -// args -// desc -// desc, args -// -// Examples: -// String -// Nullable(Nothing) -// Array(Tuple(Tuple(String, String), Tuple(String, UInt64))) +/* +ParseTypeDesc parses the type description that ClickHouse provides. + +The grammar is quite simple: + + desc + name + name() + name(args) + args + desc + desc, args + +Examples: + + String + Nullable(Nothing) + Array(Tuple(Tuple(String, String), Tuple(String, UInt64))) +*/ func ParseTypeDesc(s string) (*TypeDesc, error) { tokens, err := tokenizeString(s) if err != nil {