Description
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:
An example failure on CassCI is here:
You can also reproduce it trivially in ccm, or however you choose to run clusters locally:
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>
That last line should read cqlsh> instead.
Attachments
Issue Links
- links to