[
https://issues.apache.org/jira/browse/CASSANDRA-10369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903338#comment-14903338
]
Jim Witschey commented on CASSANDRA-10369:
------------------------------------------
Works on my machine; +1. Thanks!
> cqlsh prompt includes name of keyspace after failed `use` statement
> -------------------------------------------------------------------
>
> Key: CASSANDRA-10369
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10369
> Project: Cassandra
> Issue Type: Bug
> Reporter: Jim Witschey
> Assignee: Robert Stupp
> Priority: Minor
> Labels: cqlsh
> Fix For: 3.0.0 rc2
>
>
> I found this while addressing CASSANDRA-10289.
> In cqlsh, if the user enters {{USE ks}}, but there is no keyspace named
> {{ks}}, the prompt will read {{cqlsh:ks>}}. It should just read {{cqlsh>}},
> since the underlying session did not actually switch to use {{ks}}.
> I believe the bug is in cqlsh and not, e.g., the driver, because the
> statement, as expected, raises an {{InvalidRequest}} error.
> The behavior shows in a test in the cqlshlib nosetests here:
> https://github.com/apache/cassandra/blob/03f556ffa8718754fe4eb329af2002d83ffc7147/pylib/cqlshlib/test/test_cqlsh_output.py#L545
> An example failure on CassCI is here:
> http://cassci.datastax.com/job/scratch_mambocab-fix_cqlsh/11/testReport/cqlshlib.test.test_cqlsh_output/TestCqlshOutput/test_prompt/
> You can also reproduce it trivially in ccm, or however you choose to run
> clusters locally:
> {code}
> ccm create cqlsh -v git:trunk -n 1 ; ccm start --wait-for-binary-proto ; ccm
> node1 cqlsh
> http://git-wip-us.apache.org/repos/asf/cassandra.git git:trunk
> Fetching Cassandra updates...
> Current cluster is now: cqlsh
> Connected to cqlsh at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 3.0.0-beta2-SNAPSHOT | CQL spec 3.3.1 | Native
> protocol v4]
> Use HELP for help.
> cqlsh> use nonexistentkeyspace;
> InvalidRequest: code=2200 [Invalid query] message="Keyspace
> 'nonexistentkeyspace' does not exist"
> cqlsh:nonexistentkeyspace>
> {code}
> That last line should read {{cqlsh>}} instead.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)