File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Bug Fixes
1919 called
2020* Avoid race condition that could leave ResponseFuture callbacks uncalled
2121 if the callback was added outside of the event loop thread (github issue #95)
22+ * Properly escape keyspace name in Session.set_keyspace(). Previously, the
23+ keyspace name was quoted, but any quotes in the string were not escaped.
2224
2325Other
2426-----
Original file line number Diff line number Diff line change 3131 PreparedQueryNotFound ,
3232 IsBootstrappingErrorMessage , named_tuple_factory ,
3333 dict_factory )
34- from cassandra .metadata import Metadata
34+ from cassandra .metadata import Metadata , protect_name
3535from cassandra .policies import (RoundRobinPolicy , SimpleConvictionPolicy ,
3636 ExponentialReconnectionPolicy , HostDistance ,
3737 RetryPolicy )
@@ -1253,7 +1253,7 @@ def set_keyspace(self, keyspace):
12531253 Set the default keyspace for all queries made through this Session.
12541254 This operation blocks until complete.
12551255 """
1256- self .execute ('USE "%s" ' % (keyspace ,))
1256+ self .execute ('USE %s ' % (protect_name ( keyspace ) ,))
12571257
12581258 def _set_keyspace_for_all_pools (self , keyspace , callback ):
12591259 """
You can’t perform that action at this time.
0 commit comments