Skip to content

Commit

Permalink
Added some explanatory comments
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce committed Jun 25, 2024
1 parent c9f749c commit 415052d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 415052d

Please sign in to comment.