From 415052d97283dd3c7b537977e33bb50342f3b7af Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Tue, 25 Jun 2024 00:05:40 -0500 Subject: [PATCH] Added some explanatory comments --- proxy/proxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/proxy.go b/proxy/proxy.go index 74ec296..425dff1 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -818,6 +818,11 @@ func (c *client) interceptSystemQuery(hdr *frame.Header, stmt interface{}) { c.send(hdr, &message.ServerError{ErrorMessage: "Proxy unable to create new session for keyspace"}) } else { c.keyspace = s.Keyspace + // We might have received a quoted keyspace name in the UseStatement so remove any + // quotes before sending back this result message. This keeps us consistent with + // how Cassandra implements the same functionality and avoids any issues with + // drivers sending follow-on "USE" requests after wrapping the keyspace name in + // quotes. c.send(hdr, &message.SetKeyspaceResult{Keyspace: strings.Trim(s.Keyspace, "\"")}) } default: