diff --git a/CHANGES.txt b/CHANGES.txt index e48117a321..99fb988a13 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,8 @@ * Configurable client timeout for cqlsh (CASSANDRA-7516) * Include snippet of CQL query near syntax error in messages (CASSANDRA-7111) Merged from 2.0: + * (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) diff --git a/bin/cqlsh b/bin/cqlsh index 1a2df86e69..622fd07469 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -887,11 +887,16 @@ class Shell(cmd.Cmd): self.current_keyspace = ksname.lower() def do_select(self, parsed): + tracing_was_enabled = self.tracing_enabled + ksname = parsed.get_binding('ksname') + 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: statement = "%s LIMIT %d;" % (statement[:-1], DEFAULT_SELECT_LIMIT) self.perform_statement(statement, with_default_limit=with_default_limit) + self.tracing_enabled = tracing_was_enabled def perform_statement(self, statement, with_default_limit=False): stmt = SimpleStatement(statement, consistency_level=self.consistency_level)