cqlsh should automatically disable tracing when selecting from system_traces

patch by Philip Thompson and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-7641
This commit is contained in:
Mikhail Stepura 2014-08-14 13:11:34 -07:00
parent 44764c03e8
commit e7566609e2
2 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,6 @@
2.0.10
* (cqlsh) cqlsh should automatically disable tracing when selecting
from system_traces (CASSANDRA-7641)
* (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
* Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
* (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)

View File

@ -893,6 +893,9 @@ class Shell(cmd.Cmd):
if ksname is not None:
ksname = self.cql_unprotect_name(ksname)
cfname = self.cql_unprotect_name(parsed.get_binding('cfname'))
tracing_was_enabled = self.tracing_enabled
stop_tracing = ksname == 'system_traces' or (ksname is None and self.current_keyspace == 'system_traces')
self.tracing_enabled = self.tracing_enabled and not stop_tracing
statement = parsed.extract_orig()
with_default_limit = parsed.get_binding('limit') is None
if with_default_limit:
@ -900,6 +903,7 @@ class Shell(cmd.Cmd):
self.perform_statement(statement,
decoder=ErrorHandlingSchemaDecoder,
with_default_limit=with_default_limit)
self.tracing_enabled = tracing_was_enabled
def perform_statement(self, statement, decoder=None, with_default_limit=False):
if self.tracing_enabled: