Skip to content

Commit

Permalink
Merge pull request #177 from ClickHouse/fix/return-error-query-params
Browse files Browse the repository at this point in the history
fix: return error if params are not supported, but provided
  • Loading branch information
ernado authored Aug 21, 2022
2 parents 3a72bb3 + 6ad136b commit aaa1825
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ func (c *Client) Do(ctx context.Context, q Query) (err error) {
if c.conn == nil {
return ErrClosed
}
if len(q.Parameters) > 0 && !proto.FeatureParameters.In(c.protocolVersion) {
return errors.Errorf("query parameters are not supported in protocol version %d, upgrade server %q",
c.protocolVersion, c.server,
)
}
if q.QueryID == "" {
q.QueryID = uuid.New().String()
}
Expand Down

0 comments on commit aaa1825

Please sign in to comment.