From 6ad136beebed1dad1285c8e917e18089375d5bbe Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Sun, 21 Aug 2022 10:29:03 +0300 Subject: [PATCH] fix: return error if params are not supported, but provided --- query.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/query.go b/query.go index 054281fb..4a885f21 100644 --- a/query.go +++ b/query.go @@ -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() }