This is an automated email from the ASF dual-hosted git repository.

aleksey pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit c61f3902caee4a2fbff4adff6ec7ff58c09a5d09
Merge: 8c61214 dc725bc
Author: Aleksey Yeshchenko <alek...@apache.org>
AuthorDate: Mon Jul 27 16:11:50 2020 +0100

    Merge branch 'cassandra-3.0' into cassandra-3.11

 CHANGES.txt                                        |  1 +
 .../cql3/statements/AlterTypeStatement.java        | 23 ++++++++++++++++++++++
 .../cql3/validation/operations/AlterTest.java      | 19 ++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --cc CHANGES.txt
index 5f08069,a42de51..812e020
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,6 -1,5 +1,7 @@@
 -3.0.22:
 +3.11.8
 + * Frozen RawTuple is not annotated with frozen in the toString method 
(CASSANDRA-15857)
 +Merged from 3.0:
+  * Forbid altering UDTs used in partition keys (CASSANDRA-15933)
   * Fix empty/null json string representation (CASSANDRA-15896)
  Merged from 2.2:
   * Fix CQL parsing of collections when the column type is reversed 
(CASSANDRA-15814)
diff --cc src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
index 71d19fa,0f506f7..d0e2f33
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
@@@ -266,8 -288,17 +280,17 @@@ public abstract class AlterTypeStatemen
              newTypes.addAll(toUpdate.fieldTypes());
              newTypes.add(addType);
  
 -            return new UserType(toUpdate.keyspace, toUpdate.name, newNames, 
newTypes);
 +            return new UserType(toUpdate.keyspace, toUpdate.name, newNames, 
newTypes, toUpdate.isMultiCell());
          }
+ 
+         private static Collection<CFMetaData> 
findTablesReferencingTypeInPartitionKey(KeyspaceMetadata keyspace, String 
userTypeName)
+         {
+             Collection<CFMetaData> tables = new ArrayList<>();
+             filter(keyspace.tablesAndViews(),
+                    table -> any(table.partitionKeyColumns(), column -> 
column.type.referencesUserType(userTypeName)))
+                   .forEach(tables::add);
+             return tables;
+         }
      }
  
      private static class Renames extends AlterTypeStatement


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to