From a3641077ce3a507f563a6fec7b5fc8aec938abc0 Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Mon, 11 May 2026 18:49:01 +0300 Subject: [PATCH] test: assert ALTER TYPE RENAME rejected on frozen PK UDTs Add assertion that ALTER TYPE RENAME is rejected when the UDT is used as a frozen partition key column. The existing test only covered ALTER TYPE ADD. This closes the coverage gap from dtest udtencoding_test.py::test_udt_change_in_partition_key, enabling its removal. Refs: SCYLLADB-1929 --- test/cqlpy/cassandra_tests/validation/operations/alter_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/cqlpy/cassandra_tests/validation/operations/alter_test.py b/test/cqlpy/cassandra_tests/validation/operations/alter_test.py index c93fcbcb7b..2df2d34eb6 100644 --- a/test/cqlpy/cassandra_tests/validation/operations/alter_test.py +++ b/test/cqlpy/cassandra_tests/validation/operations/alter_test.py @@ -353,6 +353,9 @@ def testAlterTypeUsedInPartitionKey(cql, test_keyspace): # frozen UDT used directly in a partition key with create_table(cql, test_keyspace, f"(pk frozen<{type1}>, val int, PRIMARY KEY(pk))") as table1: assert_invalid_message(cql, type1, table1, "ALTER TYPE %s ADD v2 int;") + # Covers dtest cql_types_test.py::test_udt_change_in_partition_key + # ALTER TYPE RENAME must also be rejected on PK UDTs + assert_invalid_message(cql, type1, table1, "ALTER TYPE %s RENAME v1 TO v1_renamed;") # frozen UDT used in a frozen UDT used in a partition key with create_table(cql, test_keyspace, f"(pk frozen<{type2}>, val int, PRIMARY KEY(pk))") as table2: assert_invalid_message(cql, type1, table2, "ALTER TYPE %s ADD v2 int;")