From 39a0703b65c985c4b99eed1c045d0f00bbbcc9db Mon Sep 17 00:00:00 2001 From: Eduard Tudenhoefner Date: Thu, 9 Apr 2020 12:01:21 +0200 Subject: [PATCH] Mark system_views/system_virtual_schema as non-alterable keyspaces in cqlsh patch by Eduard Tudenhoefner; reviewed by Benjamin Lerer for CASSANDRA-15711 --- CHANGES.txt | 3 +-- pylib/cqlshlib/cql3handling.py | 2 +- pylib/cqlshlib/test/test_cqlsh_completion.py | 8 ++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index cda75854e4f2..2ad2aab3359d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0-alpha4 + * Mark system_views/system_virtual_schema as non-alterable keyspaces in cqlsh (CASSANDRA-15711) * Fail incremental repair if an old version sstable is involved (CASSANDRA-15612) * Fix overflows on StreamingTombstoneHistogramBuilder produced by large deletion times (CASSANDRA-14773) * Mark system_views/system_virtual_schema as system keyspaces in cqlsh (CASSANDRA-15706) @@ -56,8 +57,6 @@ Merged from 3.11: * Allow sstableloader to use SSL on the native port (CASSANDRA-14904) Merged from 3.0: -======= -3.0.21 * Memtable memory allocations may deadlock (CASSANDRA-15367) * Run evictFromMembership in GossipStage (CASSANDRA-15592) Merged from 2.2: diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 8738f10eb9aa..b2403a7bea68 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -35,7 +35,7 @@ def __str__(self): SYSTEM_KEYSPACES = ('system', 'system_schema', 'system_traces', 'system_auth', 'system_distributed', 'system_views', 'system_virtual_schema') -NONALTERBALE_KEYSPACES = ('system', 'system_schema') +NONALTERBALE_KEYSPACES = ('system', 'system_schema', 'system_views', 'system_virtual_schema') class Cql3ParsingRuleSet(CqlParsingRuleSet): diff --git a/pylib/cqlshlib/test/test_cqlsh_completion.py b/pylib/cqlshlib/test/test_cqlsh_completion.py index a8d671981517..d432f225c12d 100644 --- a/pylib/cqlshlib/test/test_cqlsh_completion.py +++ b/pylib/cqlshlib/test/test_cqlsh_completion.py @@ -820,3 +820,11 @@ def test_complete_in_create_index(self): def test_complete_in_drop_index(self): pass + + def test_complete_in_alter_keyspace(self): + self.trycompletions('ALTER KEY', 'SPACE ') + self.trycompletions('ALTER KEYSPACE ', '', choices=[self.cqlsh.keyspace, 'system_auth', + 'system_distributed', 'system_traces']) + self.trycompletions('ALTER KEYSPACE system_trac', "es WITH replication = {'class': '") + self.trycompletions("ALTER KEYSPACE system_traces WITH replication = {'class': '", '', + choices=['NetworkTopologyStrategy', 'SimpleStrategy'])