From 5813a9f9515a05511eb7e53bec9e92bf09563dda 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 f5bb79c..c0376d8 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. ks := parser.IdentifierFromString(s.Keyspace) c.send(hdr, &message.SetKeyspaceResult{Keyspace: ks.ID()}) }