mirror of https://github.com/apache/cassandra
Return InvalidRequest when using a keyspace that doesn't exist
patch by jbellis; reviewed by pcannon for CASSANDRA-3764
This commit is contained in:
parent
b318404e53
commit
5c66bd9d38
|
|
@ -1,4 +1,6 @@
|
|||
1.0.8
|
||||
* Return InvalidRequest when using a keyspace that doesn't exist
|
||||
(CASSANDRA-3764)
|
||||
* disallow user modification of System keyspace (CASSANDRA-3738)
|
||||
* allow using sstable2json on secondary index data (CASSANDRA-3738)
|
||||
* (cqlsh) add DESCRIBE COLUMNFAMILIES (CASSANDRA-3586)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import org.apache.cassandra.auth.AuthenticatedUser;
|
|||
import org.apache.cassandra.auth.Permission;
|
||||
import org.apache.cassandra.auth.Resources;
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
import org.apache.cassandra.config.Schema;
|
||||
import org.apache.cassandra.db.Table;
|
||||
import org.apache.cassandra.thrift.AuthenticationException;
|
||||
import org.apache.cassandra.thrift.InvalidRequestException;
|
||||
|
|
@ -70,8 +71,10 @@ public class ClientState
|
|||
return keyspace;
|
||||
}
|
||||
|
||||
public void setKeyspace(String ks)
|
||||
public void setKeyspace(String ks) throws InvalidRequestException
|
||||
{
|
||||
if (Schema.instance.getKSMetaData(ks) == null)
|
||||
throw new InvalidRequestException("Keyspace '" + ks + "' does not exist");
|
||||
keyspace = ks;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue